Template literals and string mappings have 'string' as base type

This commit is contained in:
Anders Hejlsberg 2021-11-11 05:44:44 -10:00
parent 4fca1e1fcd
commit 26a626d045

View file

@ -20747,7 +20747,7 @@ namespace ts {
function getBaseTypeOfLiteralType(type: Type): Type {
return type.flags & TypeFlags.EnumLiteral ? getBaseTypeOfEnumLiteralType(type as LiteralType) :
type.flags & TypeFlags.StringLiteral ? stringType :
type.flags & (TypeFlags.StringLiteral | TypeFlags.TemplateLiteral | TypeFlags.StringMapping) ? stringType :
type.flags & TypeFlags.NumberLiteral ? numberType :
type.flags & TypeFlags.BigIntLiteral ? bigintType :
type.flags & TypeFlags.BooleanLiteral ? booleanType :