We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4da5dfa commit 4168a25Copy full SHA for 4168a25
src/dotty/tools/dotc/transform/Erasure.scala
@@ -254,7 +254,7 @@ object Erasure extends TypeTestsCasts{
254
case MethodType(Nil, _) if tree.isTerm =>
255
adaptToType(tree.appliedToNone, pt)
256
case tpw =>
257
- if (pt.isInstanceOf[ProtoType] || (!isNonJVMBottomType(tree.tpe) && (tree.tpe <:< pt)))
+ if (pt.isInstanceOf[ProtoType] || ((!pt.isValueType || !isNonJVMBottomType(tree.tpe)) && (tree.tpe <:< pt)))
258
tree
259
else if (tpw.isErasedValueType)
260
adaptToType(box(tree), pt)
0 commit comments