Skip to content

No error thrown for constructors with type parameters #12064

@sosukesuzuki

Description

@sosukesuzuki

Bug Report

  • I would like to work on a fix!

Current behavior

REPL Link

No error thrown.

Input Code

class C {
  constructor<T>(foo: T) {}
}

Expected behavior

It throws Syntax Error Type parameters cannot appear on a constructor declaration. like TypeScript TS Playground Link

Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)

  • Filename: babel.config.js
{
  "presets": ["@babel/preset-typescript"]
}

Environment
I don't think environment information is needed because this issue is simple, but I will provide it if it is needed for you guys.

Possible Solution

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: typescriptoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions