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 c787fe1 commit 14d20d9Copy full SHA for 14d20d9
src/dotty/tools/dotc/transform/TypeTestsCasts.scala
@@ -47,7 +47,7 @@ trait TypeTestsCasts {
47
48
def transformIsInstanceOf(expr:Tree, argType: Type): Tree = {
49
def argCls = argType.classSymbol
50
- if (false && expr.tpe <:< argType)
+ if ((expr.tpe <:< argType) && isPureExpr(expr))
51
Literal(Constant(true)) withPos tree.pos
52
else if (argCls.isPrimitiveValueClass)
53
if (qualCls.isPrimitiveValueClass) Literal(Constant(qualCls == argCls)) withPos tree.pos
0 commit comments