Skip to content

Type parameters sharing parameter names are inaccessible from constraints #25672

Closed
@wesleyolis

Description

@wesleyolis

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 []

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions