Skip to content

Incorrect superTypeArguments parsing #17719

@fisker

Description

@fisker

💻

  • Would you like to work on a fix?

How are you using Babel?

Programmatic API (babel.transform, babel.parse)

Input code

The following two cases

class A extends B<T>
{}
//              ^^^^ ClassDeclaration.superClass
//              ^^^ ClassDeclaration.superClass.typeArguments
class B extends B<T>{}
//              ^    ClassDeclaration.superClass
//              ^^^ ClassDeclaration.superTypeArguments

are parsed differently.

Configuration file name

No response

Configuration

No response

Current and expected behavior

I think they should be the same, I didn't see differences in AST from TypeScript.

Environment

System:
OS: Windows 10 10.0.19045
Binaries:
Node: 24.11.1 - ~\AppData\Local\fnm_multishells\23500_1769001431766\node.EXE
Yarn: 4.12.0 - D:\npm\yarn.CMD
npm: 9.1.2 - ~\AppData\Local\fnm_multishells\23500_1769001431766\npm.CMD
bun: 1.3.5 - ~.bun\bin\bun.EXE
npmPackages:
@babel/code-frame: 8.0.0-beta.4 => 8.0.0-beta.4
@babel/generator: 8.0.0-beta.4 => 8.0.0-beta.4
@babel/parser: 8.0.0-beta.4 => 8.0.0-beta.4
@babel/types: 8.0.0-beta.4 => 8.0.0-beta.4
eslint: 9.39.2 => 9.39.2
jest: 30.2.0 => 30.2.0

Possible solution

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions