Skip to content

Commit 5498b01

Browse files
committed
Temporary ad-hoc fix for scala#3971.
1 parent 17019df commit 5498b01

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/src/dotty/tools/dotc/ast/TreeInfo.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,8 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
396396
private def refPurity(tree: Tree)(implicit ctx: Context): PurityLevel =
397397
if (!tree.tpe.widen.isParameterless) Pure
398398
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.
399+
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.
400401
else Pure
401402

402403
def isPureRef(tree: Tree)(implicit ctx: Context) =

0 commit comments

Comments
 (0)