File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
compiler/src/dotty/tools/dotc/ast Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -399,9 +399,9 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
399399 case Apply (fn, args) =>
400400 def isKnownPureOp (sym : Symbol ) =
401401 sym.owner.isPrimitiveValueClass || sym.owner == defn.StringClass
402- if (tree.tpe.isInstanceOf [ConstantType ] && isKnownPureOp(tree.symbol)
403- // A constant expression with pure arguments is pure.
404- || fn.symbol.isStable)
402+ if (tree.tpe.isInstanceOf [ConstantType ] && isKnownPureOp(tree.symbol) // A constant expression with pure arguments is pure.
403+ || fn.symbol.isStable
404+ || fn.symbol.isPrimaryConstructor && fn.symbol.owner.isNoInitsClass) // TODO: include in isStable?
405405 minOf(exprPurity(fn), args.map(exprPurity)) `min` Pure
406406 else if (fn.symbol.is(Erased )) Pure
407407 else Impure
You can’t perform that action at this time.
0 commit comments