Skip to content

Commit 087dcb2

Browse files
committed
Exclude old number/enum literal compatibility rule from comparable relation
1 parent 154f209 commit 087dcb2

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
@@ -16750,7 +16750,7 @@ namespace ts {
1675016750
// numeric enum literal type. This rule exists for backwards compatibility reasons because
1675116751
// bit-flag enum types sometimes look like literal enum types with numeric literal values.
1675216752
if (s & (TypeFlags.Number | TypeFlags.NumberLiteral) && !(s & TypeFlags.EnumLiteral) && (
16753-
t & TypeFlags.Enum || t & TypeFlags.NumberLiteral && t & TypeFlags.EnumLiteral)) return true;
16753+
t & TypeFlags.Enum || relation === assignableRelation && t & TypeFlags.NumberLiteral && t & TypeFlags.EnumLiteral)) return true;
1675416754
}
1675516755
return false;
1675616756
}

0 commit comments

Comments
 (0)