File tree 1 file changed +5
-4
lines changed
compiler/src/dotty/tools/dotc/ast
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -393,20 +393,21 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
393
393
case Ident (_) =>
394
394
refPurity(tree)
395
395
case Select (qual, _) =>
396
- refPurity(tree).min(exprPurity(qual))
396
+ if (tree.symbol.is(Erased )) Pure
397
+ else refPurity(tree).min(exprPurity(qual))
397
398
case New (_) =>
398
399
SimplyPure
399
400
case TypeApply (fn, _) =>
400
- exprPurity(fn)
401
+ if (fn.symbol.is( Erased )) Pure else exprPurity(fn)
401
402
case Apply (fn, args) =>
402
403
def isKnownPureOp (sym : Symbol ) =
403
404
sym.owner.isPrimitiveValueClass || sym.owner == defn.StringClass
404
405
if (tree.tpe.isInstanceOf [ConstantType ] && isKnownPureOp(tree.symbol)
405
406
// A constant expression with pure arguments is pure.
406
407
|| fn.symbol.isStable)
407
408
minOf(exprPurity(fn), args.map(exprPurity)) `min` Pure
408
- else
409
- Impure
409
+ else if (fn.symbol.is( Erased )) Pure
410
+ else Impure
410
411
case Typed (expr, _) =>
411
412
exprPurity(expr)
412
413
case Block (stats, expr) =>
You can’t perform that action at this time.
0 commit comments