Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Bug: Something is wrong inConverter#convertTypeArgumentsToTypeParameterInstantiation() #11245

Open
Labels
bugSomething isn't workingtriageWaiting for team members to take a look
@fisker

Description

@fisker

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

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageWaiting for team members to take a look

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp