Skip to content

Compiler enters infinite loop when class extends itself #2201

Closed
@romdotdog

Description

@romdotdog

Code

class Foo extends Foo {
  bar(): void {}
}

Strangely if you omit the void return type like this

class Foo extends Foo {
  bar() {}
}

only the AS playground enters an infinite loop while the main branch just exits with a parse error

  ERROR TS1110: Type expected.

     bar() {}
          ^
   in test.ts(2,8)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions