-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
FixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
TypeScript Version: 2.1.5
Code
let key: keyof string[]
key = 1 // Type '1' is not assignable to type '"length" | "toString" | "toLocaleString" | "push" | "pop" | "concat" | "join" | "reverse" | "shif...'.
interface Container<T> {
[index: number]: T
}
let key: keyof Container<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>
LennyLixalot, ersimont, LucasBertrand and ryym
Metadata
Metadata
Assignees
Labels
FixedA PR has been merged for this issueA PR has been merged for this issue