mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-10 15:25:54 -06:00
Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
This commit is contained in:
parent
b547906da5
commit
d1259a1188
@ -18768,8 +18768,12 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
// If none of the type arguments for the outer type parameters contain type variables, it follows
|
||||
// that the instantiated type doesn't reference type variables.
|
||||
if (result.flags & TypeFlags.ObjectFlagsType && !((result as ObjectFlagsType).objectFlags & ObjectFlags.CouldContainTypeVariablesComputed)) {
|
||||
(result as ObjectFlagsType).objectFlags |= ObjectFlags.CouldContainTypeVariablesComputed |
|
||||
(some(typeArguments, couldContainTypeVariables) ? ObjectFlags.CouldContainTypeVariables : 0);
|
||||
const resultCouldContainTypeVariables = some(typeArguments, couldContainTypeVariables);
|
||||
// The above check may have caused the result's objectFlags to update if the result is referenced via typeArguments.
|
||||
if (!((result as ObjectFlagsType).objectFlags & ObjectFlags.CouldContainTypeVariablesComputed)) {
|
||||
(result as ObjectFlagsType).objectFlags |= ObjectFlags.CouldContainTypeVariablesComputed |
|
||||
(resultCouldContainTypeVariables ? ObjectFlags.CouldContainTypeVariables : 0);
|
||||
}
|
||||
}
|
||||
target.instantiations.set(id, result);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user