Open
Description
TypeScript Version: 2.7.1, 2.8.0-dev.20180208
Search Terms:
Type cannot be used to index type
Code
interface IExample {
foo: {
bar: {
baz: number;
}
}
}
type F = <
name extends keyof IExample,
val extends keyof IExample[name]
>() => IExample[name][val]['baz']; // ← Type '"baz"' cannot be used to index type 'IExample[name][val]'.
Expected behavior:
In version 2.7.0-dev.20171115 this code was checking without errors.
Actual behavior:
Now in throws error: Type '"baz"' cannot be used to index type 'IExample[name][val]'.