Skip to content

Commit c84126d

Browse files
committed
Fix checking code
Caused cyclic reference exceptions before
1 parent 55e2520 commit c84126d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,10 +1516,14 @@ object Types {
15161516
/** Hook for adding debug check code when denotations are assigned */
15171517
final def checkDenot()(implicit ctx: Context) =
15181518
if (Config.checkTypeRefCycles)
1519-
lastDenotation.info match {
1520-
case TypeBounds(lo, hi) =>
1521-
assert(lo ne this)
1522-
assert(hi ne this)
1519+
lastDenotation match {
1520+
case d: SingleDenotation =>
1521+
d.infoOrCompleter match {
1522+
case TypeBounds(lo, hi) =>
1523+
assert(lo ne this)
1524+
assert(hi ne this)
1525+
case _ =>
1526+
}
15231527
case _ =>
15241528
}
15251529

0 commit comments

Comments
 (0)