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
66
66
* whole-program analysis. However, the check is not modular in terms of project boundaries.
67
67
*
68
68
*/
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" )
70
72
71
73
// ----------------------------- abstract domain -----------------------------
72
74
@@ -1683,12 +1685,11 @@ class Objects:
1683
1685
end if
1684
1686
1685
1687
// class body
1686
- val whiteList = Set (" scala.collection.immutable.Vector.emptyIterator " )
1688
+ val whiteList = Set (HashSetBuilder_rootNode )
1687
1689
tpl.body.foreach {
1688
1690
case vdef : ValDef if ! vdef.symbol.is(Flags .Lazy ) && ! vdef.rhs.isEmpty =>
1689
- var res = eval(vdef.rhs, thisV, klass)
1690
1691
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)
1692
1693
if sym.is(Flags .Mutable ) then
1693
1694
val addr = Heap .fieldVarAddr(summon[Regions .Data ], sym, State .currentObject)
1694
1695
thisV.initVar(sym, addr)
You can’t perform that action at this time.
0 commit comments