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 {
2438
2438
private [this ] var myRef : Type = null
2439
2439
private [this ] var computed = false
2440
2440
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
+ }
2442
2449
else {
2443
2450
computed = true
2444
2451
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