Use correct base primitive type

This commit is contained in:
Ron Buckton
2017-11-15 17:12:05 -08:00
parent 86b0759b09
commit 0b24f02aae

View File

@@ -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;