Remove unwrapParenthesizedType, use skipTypeParentheses (#58768)

This commit is contained in:
Jake Bailey 2024-06-03 16:39:38 -07:00 committed by GitHub
parent 370228311c
commit afad09986d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 10 deletions

View File

@ -1088,7 +1088,6 @@ import {
UnionType,
UnionTypeNode,
UniqueESSymbolType,
unwrapParenthesizedType,
usingSingleLineStringWriter,
VariableDeclaration,
VariableDeclarationList,
@ -8603,7 +8602,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
}
function tryVisitSimpleTypeNode(node: TypeNode): TypeNode | undefined {
const innerNode = unwrapParenthesizedType(node);
const innerNode = skipTypeParentheses(node);
switch (innerNode.kind) {
case SyntaxKind.TypeReference:
return tryVisitTypeReference(innerNode as TypeReferenceNode);

View File

@ -11644,14 +11644,6 @@ export function unwrapParenthesizedExpression(o: Expression) {
return o;
}
/** @internal */
export function unwrapParenthesizedType(o: TypeNode) {
while (o.kind === SyntaxKind.ParenthesizedType) {
o = (o as ParenthesizedTypeNode).type;
}
return o;
}
/** @internal */
export function hasInferredType(node: Node): node is HasInferredType {
Debug.type<HasInferredType>(node);