Skip to content

Commit 2fc14d8

Browse files
committed
Remove added type predicates
I forgot that 'f(x): x is T' implies that x is *not* T if f returns false.
1 parent d4708dc commit 2fc14d8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/compiler/checker.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9781,7 +9781,7 @@ namespace ts {
97819781
return type.flags & TypeFlags.TypeParameter && !getConstraintFromTypeParameter(<TypeParameter>type);
97829782
}
97839783

9784-
function isTypeReferenceWithGenericArguments(type: Type): type is TypeReference {
9784+
function isTypeReferenceWithGenericArguments(type: Type): boolean {
97859785
return getObjectFlags(type) & ObjectFlags.Reference && some((<TypeReference>type).typeArguments, t => isUnconstrainedTypeParameter(t) || isTypeReferenceWithGenericArguments(t));
97869786
}
97879787

@@ -9801,7 +9801,7 @@ namespace ts {
98019801
result += "=" + index;
98029802
}
98039803
else if (depth < 4 && isTypeReferenceWithGenericArguments(t)) {
9804-
result += "<" + getTypeReferenceId(t, typeParameters, depth + 1) + ">";
9804+
result += "<" + getTypeReferenceId(t as TypeReference, typeParameters, depth + 1) + ">";
98059805
}
98069806
else {
98079807
result += "-" + t.id;
@@ -10052,7 +10052,7 @@ namespace ts {
1005210052
getUnionType(types, /*subtypeReduction*/ true);
1005310053
}
1005410054

10055-
function isArrayType(type: Type): type is TypeReference {
10055+
function isArrayType(type: Type): boolean {
1005610056
return getObjectFlags(type) & ObjectFlags.Reference && (<TypeReference>type).target === globalArrayType;
1005710057
}
1005810058

0 commit comments

Comments
 (0)