@@ -16049,8 +16049,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
16049
16049
// mapped type, and the instantiation occurs in a context where resolving type arguments might cause a
16050
16050
// circular reference, we create a deferred type alias instantiation. This acts as a proxy for the
16051
16051
// actual instantiation, which is obtained using getResolvedType.
16052
- if (getObjectFlags(type) & (ObjectFlags.Reference | ObjectFlags.Anonymous | ObjectFlags.Mapped) && node.kind === SyntaxKind.TypeReference &&
16053
- isDeferredTypeReferenceNode(node as TypeReferenceNode, length(node.typeArguments) !== typeParameters.length)) {
16052
+ if (
16053
+ getObjectFlags(type) & (ObjectFlags.Reference | ObjectFlags.Anonymous | ObjectFlags.Mapped) && node.kind === SyntaxKind.TypeReference &&
16054
+ isDeferredTypeReferenceNode(node as TypeReferenceNode, length(node.typeArguments) !== typeParameters.length)
16055
+ ) {
16054
16056
return createDeferredTypeAliasInstantiation(symbol, node, newAliasSymbol, aliasTypeArguments);
16055
16057
}
16056
16058
return getTypeAliasInstantiation(symbol, typeArgumentsFromTypeReferenceNode(node), newAliasSymbol, aliasTypeArguments);
@@ -16723,8 +16725,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
16723
16725
function isDeferredTypeReferenceNode(node: TypeReferenceNode | ArrayTypeNode | TupleTypeNode, hasDefaultTypeArguments?: boolean) {
16724
16726
return isResolvedByTypeAlias(node) && (
16725
16727
node.kind === SyntaxKind.ArrayType ? mayResolveTypeAlias(node.elementType) :
16726
- node.kind === SyntaxKind.TupleType ? some(node.elements, mayResolveTypeAlias) :
16727
- hasDefaultTypeArguments || some(node.typeArguments, mayResolveTypeAlias)
16728
+ node.kind === SyntaxKind.TupleType ? some(node.elements, mayResolveTypeAlias) :
16729
+ hasDefaultTypeArguments || some(node.typeArguments, mayResolveTypeAlias)
16728
16730
);
16729
16731
}
16730
16732
0 commit comments