Skip to content

Commit

Permalink
Use 'true' and 'false' types when contextual type is 'boolean'
Browse files Browse the repository at this point in the history
  • Loading branch information
ahejlsberg authored and mhegazy committed Sep 9, 2016
1 parent aee1bf6 commit 5c11d4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13467,7 +13467,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);
Expand Down

0 comments on commit 5c11d4c

Please sign in to comment.