Skip to content

Commit b9aec28

Browse files
committed
Return early on intrinsics in couldContainTypeVariables
1 parent 2beeb8b commit b9aec28

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24004,6 +24004,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
2400424004
// we perform type inference (i.e. a type parameter of a generic function). We cache
2400524005
// results for union and intersection types for performance reasons.
2400624006
function couldContainTypeVariables(type: Type): boolean {
24007+
if (type.flags & TypeFlags.Intrinsic) return false;
2400724008
const objectFlags = getObjectFlags(type);
2400824009
if (objectFlags & ObjectFlags.CouldContainTypeVariablesComputed) {
2400924010
return !!(objectFlags & ObjectFlags.CouldContainTypeVariables);

0 commit comments

Comments
 (0)