mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-18 16:34:36 -05:00
Use 'true' and 'false' types when contextual type is 'boolean'
This commit is contained in:
@@ -13464,7 +13464,7 @@ namespace ts {
|
||||
return maybeTypeOfKind(contextualType, (TypeFlags.NumberLiteral | TypeFlags.EnumLiteral));
|
||||
}
|
||||
if (type.flags & TypeFlags.Boolean) {
|
||||
return maybeTypeOfKind(contextualType, TypeFlags.BooleanLiteral) && !isTypeAssignableTo(booleanType, contextualType);
|
||||
return maybeTypeOfKind(contextualType, TypeFlags.BooleanLiteral);
|
||||
}
|
||||
if (type.flags & TypeFlags.Enum) {
|
||||
return typeContainsLiteralFromEnum(contextualType, <EnumType>type);
|
||||
|
||||
Reference in New Issue
Block a user