File tree 2 files changed +4
-1
lines changed
compiler/src/dotty/tools/dotc/ast
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] =>
512
512
sym.owner.isPrimitiveValueClass
513
513
|| sym.owner == defn.StringClass
514
514
|| 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.
516
516
|| fn.symbol.isStableMember && ! fn.symbol.is(Lazy ) // constructors of no-inits classes are stable
517
517
518
518
/** 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