-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue
Milestone
Description
TypeScript Version: 4.1.3
Search Terms: template literal types
type Pseudo = `&:${string}`
const AmIPseudo1: Pseudo = '&:test' // Passes as expected
const AmIPseudo: Pseudo = '&' // Fails as expected
type PseudoDeclaration = {
[key in Pseudo]: string
}
// No Errors
const test: PseudoDeclaration = {
'someKey' : 'someValue'
}
Expected behavior:
test
should not be able to pass the type-checking as its key 'someKey' is not of type Pseudo
.
Actual behavior:
test
passes the type-checking.
KostyaTretyak, kohlmannj, IllusionMH, anton-toritsyn-db, brandon-leapyear and 4 more
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue