Skip to content

Commit 3428066

Browse files
author
EnzeXing
committed
Correction
1 parent 87b2ddb commit 3428066

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class Objects(using Context @constructorOnly):
8383
val immutableLazyList: Symbol = requiredModule("scala.collection.immutable.LazyList")
8484
val LazyList_empty: Symbol = immutableLazyList.requiredValue("_empty")
8585

86-
val whiteList: Set[Symbol] = Set()
86+
val whiteList: Set[Symbol] = Set(SetNode_EmptySetNode, HashSet_EmptySet, Vector_EmptyIterator, MapNode_EmptyMapNode, HashMap_EmptyMap, LazyList_empty)
8787

8888
// ----------------------------- abstract domain -----------------------------
8989

@@ -173,7 +173,7 @@ class Objects(using Context @constructorOnly):
173173
extends Ref(valsMap = mutable.Map.empty, varsMap = mutable.Map.empty, outersMap = mutable.Map.empty):
174174
val owner = klass
175175

176-
def show(using Context) = "ObjectRef(" + klass.show + ")" + "valMap = " + vals + "varMap = " + vars
176+
def show(using Context) = "ObjectRef(" + klass.show + ")"
177177

178178
/**
179179
* Represents values that are instances of the specified class.
@@ -832,7 +832,6 @@ class Objects(using Context @constructorOnly):
832832
errorReadOtherStaticObject(State.currentObject, addr)
833833
Bottom
834834
else if ref.isObjectRef && ref.klass.hasSource then
835-
println(s"Uninitialized field Position 2, ref = $ref, target = $target")
836835
report.warning("Access uninitialized field " + field.show + ". " + Trace.show, Trace.position)
837836
Bottom
838837
else
@@ -841,7 +840,6 @@ class Objects(using Context @constructorOnly):
841840
else if ref.hasVal(target) then
842841
ref.valValue(target)
843842
else if ref.isObjectRef && ref.klass.hasSource then
844-
println(s"Uninitialized field Position 2, ref = $ref, target = $target")
845843
report.warning("Access uninitialized field " + field.show + ". " + Trace.show, Trace.position)
846844
Bottom
847845
else

0 commit comments

Comments
 (0)