From a05ebc469cbef05b64011f7455b3cf8ff9e25bfe Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sun, 19 Jul 2015 11:22:32 -0700 Subject: [PATCH] Preserve order in union types --- src/compiler/checker.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 2dfba433f67..a0eed041d6e 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4076,10 +4076,6 @@ namespace ts { } } - function compareTypeIds(type1: Type, type2: Type): number { - return type1.id - type2.id; - } - // We always deduplicate the constituent type set based on object identity, but we'll also deduplicate // based on the structure of the types unless the noDeduplication flag is true, which is the case when // creating a union type from a type node and when instantiating a union type. In both of those cases, @@ -4101,7 +4097,6 @@ namespace ts { else { removeDuplicateTypes(typeSet); } - typeSet.sort(compareTypeIds); if (typeSet.length === 1) { return typeSet[0]; }