File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
compiler/src/dotty/tools/dotc/transform/init Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,9 @@ import dotty.tools.dotc.core.Flags.AbstractOrTrait
6666 * whole-program analysis. However, the check is not modular in terms of project boundaries.
6767 *
6868 */
69- class Objects :
69+ class Objects (using Context @ constructorOnly):
70+ val immutableHashSetBuider : Symbol = requiredClass(" scala.collection.immutable.HashSetBuilder" )
71+ val HashSetBuilder_rootNode : Symbol = immutableHashSetBuider.requiredValue(" rootNode" )
7072
7173 // ----------------------------- abstract domain -----------------------------
7274
@@ -1683,12 +1685,11 @@ class Objects:
16831685 end if
16841686
16851687 // class body
1686- val whiteList = Set (" scala.collection.immutable.Vector.emptyIterator " )
1688+ val whiteList = Set (HashSetBuilder_rootNode )
16871689 tpl.body.foreach {
16881690 case vdef : ValDef if ! vdef.symbol.is(Flags .Lazy ) && ! vdef.rhs.isEmpty =>
1689- var res = eval(vdef.rhs, thisV, klass)
16901691 val sym = vdef.symbol
1691- if (whiteList.contains(sym.showFullName )) res = Bottom
1692+ var res = if (whiteList.contains(sym)) Bottom else eval(vdef.rhs, thisV, klass)
16921693 if sym.is(Flags .Mutable ) then
16931694 val addr = Heap .fieldVarAddr(summon[Regions .Data ], sym, State .currentObject)
16941695 thisV.initVar(sym, addr)
You can’t perform that action at this time.
0 commit comments