@@ -8691,10 +8691,7 @@ namespace ts {
8691
8691
const len = typeSet.length;
8692
8692
const index = len && type.id > typeSet[len - 1].id ? ~len : binarySearch(typeSet, type, getTypeId, compareValues);
8693
8693
if (index < 0) {
8694
- if (!(flags & TypeFlags.Object && (<ObjectType>type).objectFlags & ObjectFlags.Anonymous &&
8695
- type.symbol && type.symbol.flags & (SymbolFlags.Function | SymbolFlags.Method) && containsIdenticalType(typeSet, type))) {
8696
- typeSet.splice(~index, 0, type);
8697
- }
8694
+ typeSet.splice(~index, 0, type);
8698
8695
}
8699
8696
}
8700
8697
}
@@ -8710,15 +8707,6 @@ namespace ts {
8710
8707
return includes;
8711
8708
}
8712
8709
8713
- function containsIdenticalType(types: ReadonlyArray<Type>, type: Type) {
8714
- for (const t of types) {
8715
- if (isTypeIdenticalTo(t, type)) {
8716
- return true;
8717
- }
8718
- }
8719
- return false;
8720
- }
8721
-
8722
8710
function isSubtypeOfAny(source: Type, targets: ReadonlyArray<Type>): boolean {
8723
8711
for (const target of targets) {
8724
8712
if (source !== target && isTypeSubtypeOf(source, target) && (
@@ -8899,10 +8887,7 @@ namespace ts {
8899
8887
if (flags & TypeFlags.AnyOrUnknown) {
8900
8888
if (type === wildcardType) includes |= TypeFlags.Wildcard;
8901
8889
}
8902
- else if ((strictNullChecks || !(flags & TypeFlags.Nullable)) && !contains(typeSet, type) &&
8903
- !(flags & TypeFlags.Object && (<ObjectType>type).objectFlags & ObjectFlags.Anonymous &&
8904
- type.symbol && type.symbol.flags & (SymbolFlags.Function | SymbolFlags.Method) &&
8905
- containsIdenticalType(typeSet, type))) {
8890
+ else if ((strictNullChecks || !(flags & TypeFlags.Nullable)) && !contains(typeSet, type)) {
8906
8891
typeSet.push(type);
8907
8892
}
8908
8893
}
0 commit comments