Skip to content

More accurate error message request on extending a specific type #27890

@zheeeng

Description

@zheeeng

As below codes showing, according to the error message, seems that type A is equivalent to an interface, but type A2 is a strict type kind type

type A<T> = {
    [P in keyof { foo: any }]: number
}

interface B<T> extends A<T> { }


type A2<T> = {
    [P in keyof T]: number
}

interface B2<T> extends A2<T> {} // An interface may only extend a class or another interface.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: Error MessagesThe issue relates to error messagingFixedA PR has been merged for this issueGood First IssueWell scoped, documented and has the green lightHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions