Skip to content

Commit 4168a25

Browse files
committed
Fix casting bottom types to non-value types.
1 parent 4da5dfa commit 4168a25

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/dotty/tools/dotc/transform/Erasure.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ object Erasure extends TypeTestsCasts{
254254
case MethodType(Nil, _) if tree.isTerm =>
255255
adaptToType(tree.appliedToNone, pt)
256256
case tpw =>
257-
if (pt.isInstanceOf[ProtoType] || (!isNonJVMBottomType(tree.tpe) && (tree.tpe <:< pt)))
257+
if (pt.isInstanceOf[ProtoType] || ((!pt.isValueType || !isNonJVMBottomType(tree.tpe)) && (tree.tpe <:< pt)))
258258
tree
259259
else if (tpw.isErasedValueType)
260260
adaptToType(box(tree), pt)

0 commit comments

Comments
 (0)