Skip to content

Infinite loop in expanding abstract class with self type #209

@Meowcolm024

Description

@Meowcolm024

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>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions