File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
compiler/src/dotty/tools/dotc/ast Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -512,7 +512,7 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
512512 sym.owner.isPrimitiveValueClass
513513 || sym.owner == defn.StringClass
514514 || defn.pureMethods.contains(sym)
515- tree.tpe.isInstanceOf [ConstantType ] && isKnownPureOp(tree.symbol) // A constant expression with pure arguments is pure.
515+ tree.tpe.isInstanceOf [ConstantType ] && tree.symbol != NoSymbol && isKnownPureOp(tree.symbol) // A constant expression with pure arguments is pure.
516516 || fn.symbol.isStableMember && ! fn.symbol.is(Lazy ) // constructors of no-inits classes are stable
517517
518518 /** The purity level of this reference.
Original file line number Diff line number Diff line change 1+ val f = [A ] => (a : A ) => a
2+ val x1 = f.apply[Int ](4 )
3+ val x2 = f.apply[4 ](4 )
You can’t perform that action at this time.
0 commit comments