Tweak isAliasedType
This commit is contained in:
parent
81bfa6f2e0
commit
a92d5992d2
1 changed files with 5 additions and 3 deletions
|
@ -9618,16 +9618,18 @@ namespace ts {
|
|||
return getTupleTypeOfArity(node.elementTypes.length, minLength, !!restElement, readonly, /*associatedNames*/ undefined);
|
||||
}
|
||||
|
||||
// Return true when the given node is transitively contained in type constructs that eagerly
|
||||
// resolve their constituent types. We include SyntaxKind.TypeReference because type arguments
|
||||
// of type aliases are eagerly resolved.
|
||||
function isAliasedType(node: Node): boolean {
|
||||
const parent = node.parent;
|
||||
switch (parent.kind) {
|
||||
case SyntaxKind.ParenthesizedType:
|
||||
case SyntaxKind.ArrayType:
|
||||
case SyntaxKind.TupleType:
|
||||
case SyntaxKind.RestType:
|
||||
case SyntaxKind.TypeReference:
|
||||
case SyntaxKind.UnionType:
|
||||
case SyntaxKind.IntersectionType:
|
||||
case SyntaxKind.IndexedAccessType:
|
||||
case SyntaxKind.ConditionalType:
|
||||
return isAliasedType(parent);
|
||||
case SyntaxKind.TypeAliasDeclaration:
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue