Skip to content

Commit ccbb355

Browse files
committed
Fix non-determinism in test
1 parent 683d537 commit ccbb355

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,6 @@ object Semantic {
204204

205205
override def toString() = map.toString()
206206
}
207-
208-
/** Note: don't use `val` to avoid incorrect sharing */
209-
private[Semantic] def empty: Heap = new Heap(Map.empty)
210207
}
211208
type Heap = Heap.Heap
212209

@@ -389,8 +386,6 @@ object Semantic {
389386
}
390387
}
391388

392-
val empty: Cache = new Cache()
393-
394389
extension (cache: CacheStore)
395390
def contains(value: Value, expr: Tree) = cache.contains(value) && cache(value).contains(expr)
396391
def get(value: Value, expr: Tree): Value = cache(value)(expr)
@@ -975,7 +970,7 @@ object Semantic {
975970
* }
976971
*/
977972
def withInitialState[T](work: State ?=> T): T = {
978-
val initialState = State(Cache.empty, Heap.empty, new WorkList)
973+
val initialState = State(new Cache, new Heap(Map.empty), new WorkList)
979974
work(using initialState)
980975
}
981976

0 commit comments

Comments
 (0)