We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 17019df commit 5498b01Copy full SHA for 5498b01
compiler/src/dotty/tools/dotc/ast/TreeInfo.scala
@@ -396,7 +396,8 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
396
private def refPurity(tree: Tree)(implicit ctx: Context): PurityLevel =
397
if (!tree.tpe.widen.isParameterless) Pure
398
else if (!tree.symbol.isStable) Impure
399
- else if (tree.symbol.is(Lazy)) Idempotent // TODO add Module flag, sinxce Module vals or not Lazy from the start.
+ else if (tree.symbol.is(Lazy) && !defn.ScalaValueClasses().contains(tree.symbol.companionClass))
400
+ Idempotent // TODO add Module flag, sinxce Module vals or not Lazy from the start.
401
else Pure
402
403
def isPureRef(tree: Tree)(implicit ctx: Context) =
0 commit comments