From 81efc8630de5cd67ee03da6e964371b49e2063af Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sun, 4 Feb 2024 14:21:47 -0800 Subject: [PATCH] Fix formatting --- src/compiler/checker.ts | 10 ++++++---- src/compiler/types.ts | 6 +++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index f0f223ca8447c..350627ba7cf82 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -16049,8 +16049,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { // mapped type, and the instantiation occurs in a context where resolving type arguments might cause a // circular reference, we create a deferred type alias instantiation. This acts as a proxy for the // actual instantiation, which is obtained using getResolvedType. - if (getObjectFlags(type) & (ObjectFlags.Reference | ObjectFlags.Anonymous | ObjectFlags.Mapped) && node.kind === SyntaxKind.TypeReference && - isDeferredTypeReferenceNode(node as TypeReferenceNode, length(node.typeArguments) !== typeParameters.length)) { + if ( + getObjectFlags(type) & (ObjectFlags.Reference | ObjectFlags.Anonymous | ObjectFlags.Mapped) && node.kind === SyntaxKind.TypeReference && + isDeferredTypeReferenceNode(node as TypeReferenceNode, length(node.typeArguments) !== typeParameters.length) + ) { return createDeferredTypeAliasInstantiation(symbol, node, newAliasSymbol, aliasTypeArguments); } return getTypeAliasInstantiation(symbol, typeArgumentsFromTypeReferenceNode(node), newAliasSymbol, aliasTypeArguments); @@ -16723,8 +16725,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { function isDeferredTypeReferenceNode(node: TypeReferenceNode | ArrayTypeNode | TupleTypeNode, hasDefaultTypeArguments?: boolean) { return isResolvedByTypeAlias(node) && ( node.kind === SyntaxKind.ArrayType ? mayResolveTypeAlias(node.elementType) : - node.kind === SyntaxKind.TupleType ? some(node.elements, mayResolveTypeAlias) : - hasDefaultTypeArguments || some(node.typeArguments, mayResolveTypeAlias) + node.kind === SyntaxKind.TupleType ? some(node.elements, mayResolveTypeAlias) : + hasDefaultTypeArguments || some(node.typeArguments, mayResolveTypeAlias) ); } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 6b6d84c9c3595..fe2095e61eeec 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -6547,9 +6547,9 @@ export interface MappedType extends AnonymousType { /** @internal */ export interface TypeAliasInstantiationType extends AnonymousType { - typeAlias: Symbol; // Type alias symbol - node: NodeWithTypeArguments; // Type alias instantiation node - resolvedType?: ObjectType; // Resolved type alias instantiation + typeAlias: Symbol; // Type alias symbol + node: NodeWithTypeArguments; // Type alias instantiation node + resolvedType?: ObjectType; // Resolved type alias instantiation } export interface EvolvingArrayType extends ObjectType {