Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Open
Description
Sorry for ignoring the issue template.
There is an issue in Prettierprettier/prettier#15463.
This issue now fixed in typescript-estree v8, but when I look into it, I found there is something wrong, I haven't found out the root cause yet.
Running this script will succeed
constcode=`type RepeatedTuple<T extends readonly any[]> = _R<T, _R<T, _R<T, _R<T, _R<T, _R<T, _R<T, _R<T, _R<T, _R<T, _R<T, _R<T, _R<T, _R<T, _R<T, _R<T, _R<T, _R<T, _R<T, _R<T, _R<T, _R<T, _R<T, _R<T, _R<T, _R<T, _R<T, _R<T, _R<T, _R<T, _R<T, _R<T, _R<T, _R<T, _R<T, _R<T, _R<T, _R<T, _R<T, _R<T, readonly []>>>>> >>>>>>>>>>>>>>>>>>> >>>>>>>>>>>>> >>>;`;console.log(require("@typescript-eslint/typescript-estree").parse(code));
However, if I callconvertTypeArgumentsToTypeParameterInstantiation
twice in this branch
typescript-eslint/packages/typescript-estree/src/convert.ts
Lines 2758 to 2768 in4ad8a07
caseSyntaxKind.TypeReference: | |
returnthis.createNode<TSESTree.TSTypeReference>(node,{ | |
type:AST_NODE_TYPES.TSTypeReference, | |
typeArguments: | |
node.typeArguments&& | |
this.convertTypeArgumentsToTypeParameterInstantiation( | |
node.typeArguments, | |
node, | |
), | |
typeName:this.convertChild(node.typeName), | |
}); |
for example:
case SyntaxKind.TypeReference: return this.createNode<TSESTree.TSTypeReference>(node, { type: AST_NODE_TYPES.TSTypeReference, typeArguments: node.typeArguments && this.convertTypeArgumentsToTypeParameterInstantiation( node.typeArguments, node, ),+ typeArguments2:+ node.typeArguments &&+ this.convertTypeArgumentsToTypeParameterInstantiation(+ node.typeArguments,+ node,+ ), typeName: this.convertChild(node.typeName), });
The parser hangs forever.
I don't think this is expected.