Skip to content

Commit 2739c47

Browse files
authored
PolymorphismBoxing for Any/Nothing (#458)
2 parents c8b42e5 + 014f810 commit 2739c47

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

effekt/shared/src/main/scala/effekt/core/PolymorphismBoxing.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,8 @@ object PolymorphismBoxing extends Phase[CoreTransformed, CoreTransformed] {
330330
case (unboxed, _: ValueType.Var) if box.isDefinedAt(unboxed) => BoxCoercer(unboxed)
331331
case (boxed, unboxed) if box.isDefinedAt(unboxed) && box(unboxed).tpe == boxed => UnboxCoercer(unboxed)
332332
case (_: ValueType.Var, unboxed) if box.isDefinedAt(unboxed) => UnboxCoercer(unboxed)
333+
case (unboxed, core.Type.TTop) if box.isDefinedAt(unboxed) => BoxCoercer(unboxed)
334+
case (core.Type.TBottom, unboxed) if box.isDefinedAt(unboxed) => UnboxCoercer(unboxed)
333335
case _ =>
334336
//Context.warning(s"Coercing ${PrettyPrinter.format(from)} to ${PrettyPrinter.format(to)}")
335337
new IdentityCoercer(from, to)

0 commit comments

Comments
 (0)