Skip to content

Commit 5c11d4c

Browse files
ahejlsbergmhegazy
authored andcommitted
Use 'true' and 'false' types when contextual type is 'boolean'
1 parent aee1bf6 commit 5c11d4c

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

0 commit comments

Comments
 (0)