TypeScript Version: 2.1.5
Code
letkey: keyofstring[]key=1// Type '1' is not assignable to type '"length" | "toString" | "toLocaleString" | "push" | "pop" | "concat" | "join" | "reverse" | "shif...'.
interfaceContainer<T>{[index: number]: T}letkey: keyofContainer<string>key=1// Type '1' is not assignable to type 'never'.Expected behavior:
number should be subtype of keyof string[] and keyof Container<string>
Actual behavior:
number is no subtype of keyof string[] and keyof Container<string>
TypeScript Version: 2.1.5
Code
Expected behavior:
numbershould be subtype ofkeyof string[]andkeyof Container<string>Actual behavior:
numberis no subtype ofkeyof string[]andkeyof Container<string>