Skip to content

Commit b7cdb9e

Browse files
committed
special case for next field of colon colon in global init checker
1 parent 837ed3a commit b7cdb9e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/src/dotty/tools/dotc/transform/init/Objects.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,8 @@ class Objects(using Context @constructorOnly):
812812
else
813813
Bottom
814814
else if target.exists then
815-
if target.isOneOf(Flags.Mutable) then
815+
def isNextFieldOfColonColon: Boolean = ref.klass.showName == "::" && target.name.toString == "next"
816+
if target.isOneOf(Flags.Mutable) && !isNextFieldOfColonColon then
816817
if ref.hasVar(target) then
817818
val addr = ref.varAddr(target)
818819
if addr.owner == State.currentObject then

0 commit comments

Comments
 (0)