Skip to content

Commit afad099

Browse files
authored
Remove unwrapParenthesizedType, use skipTypeParentheses (microsoft#58768)
1 parent 3702283 commit afad099

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,7 +1088,6 @@ import {
10881088
UnionType,
10891089
UnionTypeNode,
10901090
UniqueESSymbolType,
1091-
unwrapParenthesizedType,
10921091
usingSingleLineStringWriter,
10931092
VariableDeclaration,
10941093
VariableDeclarationList,
@@ -8603,7 +8602,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
86038602
}
86048603

86058604
function tryVisitSimpleTypeNode(node: TypeNode): TypeNode | undefined {
8606-
const innerNode = unwrapParenthesizedType(node);
8605+
const innerNode = skipTypeParentheses(node);
86078606
switch (innerNode.kind) {
86088607
case SyntaxKind.TypeReference:
86098608
return tryVisitTypeReference(innerNode as TypeReferenceNode);

src/compiler/utilities.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11644,14 +11644,6 @@ export function unwrapParenthesizedExpression(o: Expression) {
1164411644
return o;
1164511645
}
1164611646

11647-
/** @internal */
11648-
export function unwrapParenthesizedType(o: TypeNode) {
11649-
while (o.kind === SyntaxKind.ParenthesizedType) {
11650-
o = (o as ParenthesizedTypeNode).type;
11651-
}
11652-
return o;
11653-
}
11654-
1165511647
/** @internal */
1165611648
export function hasInferredType(node: Node): node is HasInferredType {
1165711649
Debug.type<HasInferredType>(node);

0 commit comments

Comments
 (0)