Skip to content

No circularity error for self referential get accessor annotations #48031

Closed
@DanielRosenwasser

Description

@DanielRosenwasser
declare class C {
    // TypeScript correctly reports an error here.
    foo: typeof this.foo;
    // TypeScript does not report an error here.
    get bar(): typeof this.bar;
}

Expected

An error on both foo and bar.

'foo' is referenced directly or indirectly in its own type annotation.
'bar' is referenced directly or indirectly in its own type annotation.

Actual

Just an error on bar.

'bar' is referenced directly or indirectly in its own type annotation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions