Skip to content

Commit 23510e8

Browse files
committed
Readopt older candidateType check, even though it shouldnt really matter
1 parent f8b9741 commit 23510e8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20568,7 +20568,7 @@ namespace ts {
2056820568
// this a literal context for literals of that primitive type. For example, given a
2056920569
// type parameter 'T extends string', infer string literal types for T.
2057020570
const constraint = getBaseConstraintOfType(contextualType) || emptyObjectType;
20571-
return constraint === keyofConstraintType ||
20571+
return constraint === keyofConstraintType && maybeTypeOfKind(candidateType, TypeFlags.StringLiteral | TypeFlags.NumberLiteral | TypeFlags.UniqueESSymbol) ||
2057220572
constraint.flags & TypeFlags.String && maybeTypeOfKind(candidateType, TypeFlags.StringLiteral) ||
2057320573
constraint.flags & TypeFlags.Number && maybeTypeOfKind(candidateType, TypeFlags.NumberLiteral) ||
2057420574
constraint.flags & TypeFlags.Boolean && maybeTypeOfKind(candidateType, TypeFlags.BooleanLiteral) ||

0 commit comments

Comments
 (0)