The following code causes an infinite loop in type checking
abstract class Foo[T]: Bar { fun x: T }
abstract class Bar(val x: Int) extends Foo[Int] { fun f(y) = this.x + y }
fun test(f: Foo['a]) = if f is Foo then f.x
- for an abstract
Bar, we have Bar => (#Bar<Object,Foo> & Bar)
- for a non abstract
Bar, we have Bar => #Bar<Object,Foo>