-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
TypeScript Version: 2.9.0-dev.20180430
Code
interface I {
x: any;
}
type Foo<T extends number> = T;
declare function f<K extends keyof I>(type: K): Foo<I[K]>;Expected behavior:
No error.
Actual behavior:
src/a.ts:5:53 - error TS2344: Type 'I[K]' does not satisfy the constraint 'number'.
5 declare function f<K extends keyof I>(type: K): Foo<I[K]>;This was broken by #23768 (fc2f16c): tested that it worked in the commit before it, 4e401ca .
Discovered in ember-data on DefinitelyTyped.
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue