Skip to content

Type parameters sharing parameter names are inaccessible from constraints #25672

Description

Templating the constraint as of 2018.07.12, results in error

I hope you have a better title or know were to file this one, or whether it should be a
feature request.

// Error, Key A only refers to a type but is being used here as a value.

function KeyRef<O extends {}, KeyA extends keyof O, keyB extends O[KeyA]>(object  : O, KeyA : KeyA, KeyB : KeyB) : string []
function KeyRef<O extends {}, KeyA extends keyof O>(object  : O, K : KeyA) : string []
function KeyRef<O extends {}, S extends any>(object  : O, Keys : any) : string []

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugA bug in TypeScript

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions