Skip to content

Commit 61e7be1

Browse files
committed
Add regression test for #2941
1 parent ab3bc41 commit 61e7be1

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/pos/i2941.scala

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
trait FooBase {
2+
type Bar >: Null <: BarBase { type This <: FooBase.this.Bar }
3+
type This >: this.type <: FooBase { type This <: FooBase.this.This }
4+
5+
def derived(bar: Bar): This = ???
6+
}
7+
8+
trait BarBase {
9+
type This >: Null <: BarBase { type This <: BarBase.this.This }
10+
}
11+
12+
object Test {
13+
def bad(foo: FooBase): FooBase = foo match {
14+
case foo: FooBase =>
15+
foo.derived(???) // Triggers infinite loop in TypeAssigner.avoid()
16+
}
17+
}

0 commit comments

Comments
 (0)