Ensure no duplicates in named union list

This commit is contained in:
Anders Hejlsberg 2021-02-24 09:48:26 -08:00
parent 26bbdf1173
commit 361e19bbe8

View file

@ -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);