Skip to content

Commit 9b21b46

Browse files
committed
Handle LazyRefs conservatively in isReferredTo
Without the change we risk losing RecTypes because it looks like nobody refers to them. This was observed for pos/i974.scala.
1 parent de29cd1 commit 9b21b46

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/dotty/tools/dotc/core/Types.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2265,6 +2265,8 @@ object Types {
22652265
tp match {
22662266
case tp: TypeRef => apply(x, tp.prefix)
22672267
case tp: RecThis => RecType.this eq tp.binder
2268+
case tp: LazyRef => true // Assume a reference to be safe.
2269+
// TODO: Check that all accumulators handle LazyRefs correctly
22682270
case _ => foldOver(x, tp)
22692271
}
22702272
}

0 commit comments

Comments
 (0)