File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
src/dotty/tools/dotc/transform Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -400,7 +400,7 @@ object Erasure extends TypeTestsCasts{
400
400
}
401
401
402
402
override def typedTypeApply (tree : untpd.TypeApply , pt : Type )(implicit ctx : Context ) = {
403
- val ntree = interceptTypeApply(tree.asInstanceOf [TypeApply ])
403
+ val ntree = interceptTypeApply(tree.asInstanceOf [TypeApply ])(ctx.withPhase(ctx.erasurePhase))
404
404
405
405
ntree match {
406
406
case TypeApply (fun, args) =>
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ trait TypeTestsCasts {
47
47
48
48
def transformIsInstanceOf (expr: Tree , argType : Type ): Tree = {
49
49
def argCls = argType.classSymbol
50
- if (expr.tpe <:< argType)
50
+ if (( expr.tpe <:< argType) && isPureExpr(expr) )
51
51
Literal (Constant (true )) withPos tree.pos
52
52
else if (argCls.isPrimitiveValueClass)
53
53
if (qualCls.isPrimitiveValueClass) Literal (Constant (qualCls == argCls)) withPos tree.pos
You can’t perform that action at this time.
0 commit comments