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.
TypeScript Version: 2.9.0-dev.20180430
Code
Expected behavior:
No error.
Actual behavior:
This was broken by #23768 (fc2f16c): tested that it worked in the commit before it, 4e401ca .
Discovered in
ember-dataon DefinitelyTyped.