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 82afe5f commit f786ce5Copy full SHA for f786ce5
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 (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