Skip to content

Commit a92d599

Browse files
committed
Tweak isAliasedType
1 parent 81bfa6f commit a92d599

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/compiler/checker.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9618,16 +9618,18 @@ namespace ts {
96189618
return getTupleTypeOfArity(node.elementTypes.length, minLength, !!restElement, readonly, /*associatedNames*/ undefined);
96199619
}
96209620

9621+
// Return true when the given node is transitively contained in type constructs that eagerly
9622+
// resolve their constituent types. We include SyntaxKind.TypeReference because type arguments
9623+
// of type aliases are eagerly resolved.
96219624
function isAliasedType(node: Node): boolean {
96229625
const parent = node.parent;
96239626
switch (parent.kind) {
96249627
case SyntaxKind.ParenthesizedType:
9625-
case SyntaxKind.ArrayType:
9626-
case SyntaxKind.TupleType:
9627-
case SyntaxKind.RestType:
9628+
case SyntaxKind.TypeReference:
96289629
case SyntaxKind.UnionType:
96299630
case SyntaxKind.IntersectionType:
96309631
case SyntaxKind.IndexedAccessType:
9632+
case SyntaxKind.ConditionalType:
96319633
return isAliasedType(parent);
96329634
case SyntaxKind.TypeAliasDeclaration:
96339635
return true;

0 commit comments

Comments
 (0)