mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-16 07:13:45 -05:00
Use correct base primitive type
This commit is contained in:
@@ -18842,7 +18842,7 @@ namespace ts {
|
||||
// If the type parameter is constrained to the base primitive type we're checking for,
|
||||
// consider this a literal context. For example, given a type parameter 'T extends string',
|
||||
// this causes us to infer string literal types for T.
|
||||
if (constraint.flags & (TypeFlags.String | TypeFlags.Number | TypeFlags.Boolean | TypeFlags.Enum | TypeFlags.UniqueESSymbol)) {
|
||||
if (constraint.flags & (TypeFlags.String | TypeFlags.Number | TypeFlags.Boolean | TypeFlags.Enum | TypeFlags.Symbol)) {
|
||||
return true;
|
||||
}
|
||||
contextualType = constraint;
|
||||
|
||||
Reference in New Issue
Block a user