Skip to content

Identity comparisons of type parameters with different names #5378

@osdm

Description

@osdm

From spec, 3.11.2:

Two call or construct signatures are considered identical when they have the same number of type
parameters with identical type parameter constraints and, after substituting type Any for the type
parameters introduced by the signatures, identical number of parameters with identical kind (required, optional or rest) and types, and identical return types

Nowhere does it say that type parameters should have identical names.

But this code is highlighted with error in playground:

class c {
    get x(): <T>(a: T) => T { return null; }
    set x(p: <U>(a: U) => U) {}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issueHelp WantedYou can do this

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions