mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-27 22:39:59 -05:00
Properly handle duplicate enum types in type inference (#42943)
* Ensure no duplicates in named union list * Add regression test
This commit is contained in:
@@ -13460,7 +13460,7 @@ namespace ts {
|
||||
if (t.flags & TypeFlags.Union) {
|
||||
const origin = (<UnionType>t).origin;
|
||||
if (t.aliasSymbol || origin && !(origin.flags & TypeFlags.Union)) {
|
||||
namedUnions.push(t);
|
||||
pushIfUnique(namedUnions, t);
|
||||
}
|
||||
else if (origin && origin.flags & TypeFlags.Union) {
|
||||
addNamedUnions(namedUnions, (<UnionType>origin).types);
|
||||
|
||||
Reference in New Issue
Block a user