Skip to content

Commit d240351

Browse files
committed
Look inside lazy refs for dependency tracking
1 parent bb5d1f3 commit d240351

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

compiler/src/dotty/tools/dotc/core/OrderingConstraint.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ class OrderingConstraint(private val boundsMap: ParamBounds,
245245

246246
private class Adjuster(srcParam: TypeParamRef)(using Context) extends TypeTraverser:
247247
var add: Boolean = compiletime.uninitialized
248+
val seen = util.HashSet[LazyRef]()
248249

249250
def update(deps: ReverseDeps, referenced: TypeParamRef): ReverseDeps =
250251
val prev = deps.at(referenced)
@@ -255,7 +256,10 @@ class OrderingConstraint(private val boundsMap: ParamBounds,
255256
if contains(param) then
256257
if variance >= 0 then coDeps = update(coDeps, param)
257258
if variance <= 0 then contraDeps = update(contraDeps, param)
258-
case tp: LazyRef if !tp.completed =>
259+
case tp: LazyRef =>
260+
if !seen.contains(tp) then
261+
seen += tp
262+
traverse(tp.ref)
259263
case _ => traverseChildren(t)
260264
end Adjuster
261265

0 commit comments

Comments
 (0)