File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -2438,7 +2438,14 @@ object Types {
24382438 private [this ] var myRef : Type = null
24392439 private [this ] var computed = false
24402440 def ref (implicit ctx : Context ): Type = {
2441- if (computed) assert(myRef != null )
2441+ if (computed) {
2442+ if (myRef == null ) {
2443+ // if errors were reported previously handle this by throwing a CyclicReference
2444+ // instead of crashing immediately. A test case is neg/i6057.scala.
2445+ assert(ctx.reporter.errorsReported)
2446+ CyclicReference (NoDenotation )
2447+ }
2448+ }
24422449 else {
24432450 computed = true
24442451 myRef = refFn(ctx)
Original file line number Diff line number Diff line change 1+ class i0 [i1] {
2+ type i2 <: i0[i2]
3+ val i3 : i2[i4] {} // error
4+ }
You can’t perform that action at this time.
0 commit comments