Closed as not planned
Closed as not planned
Description
Sorry for ignoring the issue template.
There is an issue in Prettier prettier/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
const code = `
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 call convertTypeArgumentsToTypeParameterInstantiation
twice in this branch
typescript-eslint/packages/typescript-estree/src/convert.ts
Lines 2758 to 2768 in 4ad8a07
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.