File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/dotty/tools/dotc/transform Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import core.TypeErasure.isUnboundedGeneric
13
13
import typer .ErrorReporting ._
14
14
import ast .Trees ._
15
15
import Erasure .Boxing ._
16
+ import core .TypeErasure ._
16
17
17
18
/** This transform normalizes type tests and type casts,
18
19
* also replacing type tests with singleton argument type with reference equality check
@@ -92,11 +93,11 @@ trait TypeTestsCasts {
92
93
else
93
94
derivedTree(qual, defn.Any_asInstanceOf , argType)
94
95
}
95
-
96
+ def erasedArg = erasure(tree.args.head.tpe)
96
97
if (sym eq defn.Any_isInstanceOf )
97
- transformIsInstanceOf(qual, tree.args.head.tpe )
98
+ transformIsInstanceOf(qual, erasedArg )
98
99
else if (sym eq defn.Any_asInstanceOf )
99
- transformAsInstanceOf(tree.args.head.tpe )
100
+ transformAsInstanceOf(erasedArg )
100
101
else tree
101
102
102
103
case _ =>
You can’t perform that action at this time.
0 commit comments