Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Syntax error is thrown for override modifiers for parameter properties #13427

Closed
1 task done
sosukesuzuki opened this issue Jun 6, 2021 · 0 comments 路 Fixed by #13428
Closed
1 task done

[Bug]: Syntax error is thrown for override modifiers for parameter properties #13427

sosukesuzuki opened this issue Jun 6, 2021 · 0 comments 路 Fixed by #13428
Labels
area: typescript i: bug outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: parser

Comments

@sosukesuzuki
Copy link
Member

sosukesuzuki commented Jun 6, 2021

馃捇

  • Would you like to work on a fix?

How are you using Babel?

Programmatic API (babel.transform, babel.parse)

Input code

class D extends B {
  constructor(protected  override  readonly  foo: string) {
    super(foo);
  }
}

Configuration file name

No response

Configuration

const { parse } = require("@babel/parser");

parse(`class D extends B {
  constructor(protected  override  readonly  foo: string) {
    super(foo);
  }
}`, { plugins: ["typescript"] });

Current and expected behavior

Current:

Syntax error Unexpected token, expected "," (2:35) is thrown.(Babel try it out link)

Expected:

Success to parse

Environment

Use latest babel/parser directly.

Possible solution

No response

Additional context

from: prettier/prettier#11017
TS Playground Link
TypeScript Compiler allows this syntax explicitly (ref: microsoft/TypeScript#43831)

@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Sep 10, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: typescript i: bug outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: parser
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant