Skip to content

Commit dba3109

Browse files
committed
Use 'true' and 'false' types when contextual type is 'boolean'
1 parent 65ef06e commit dba3109

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
@@ -13464,7 +13464,7 @@ namespace ts {
1346413464
return maybeTypeOfKind(contextualType, (TypeFlags.NumberLiteral | TypeFlags.EnumLiteral));
1346513465
}
1346613466
if (type.flags & TypeFlags.Boolean) {
13467-
return maybeTypeOfKind(contextualType, TypeFlags.BooleanLiteral) && !isTypeAssignableTo(booleanType, contextualType);
13467+
return maybeTypeOfKind(contextualType, TypeFlags.BooleanLiteral);
1346813468
}
1346913469
if (type.flags & TypeFlags.Enum) {
1347013470
return typeContainsLiteralFromEnum(contextualType, <EnumType>type);

0 commit comments

Comments
 (0)