Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ahejlsberg committed Feb 4, 2024
1 parent ad0a847 commit 81efc86
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
10 changes: 6 additions & 4 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
);
}

Expand Down
6 changes: 3 additions & 3 deletions src/compiler/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 81efc86

Please sign in to comment.