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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaks on create<A extends typeof Base<T>>(this: A) : InstanceType<A> #12953

Closed
cpakken opened this issue May 29, 2022 · 2 comments
Closed

Breaks on create<A extends typeof Base<T>>(this: A) : InstanceType<A> #12953

cpakken opened this issue May 29, 2022 · 2 comments

Comments

@cpakken
Copy link

cpakken commented May 29, 2022

Prettier 2.6.2
Playground link

--parser babel

Input:

class Base<T> {}

interface SomeExtensionClass<T> {
  create<A extends typeof Base<T>>(this: A) : InstanceType<A>
}

Output:

SyntaxError: Unexpected token, expected "," (4:12)
  2 |
  3 | interface SomeExtensionClass<T> {
> 4 |   create<A extends typeof Base<T>>(this: A) : InstanceType<A>
    |            ^
  5 | }

Expected behavior:
This is valid typescript should be able to format

@Josh-Cena
Copy link

Instantiation expressions are parsed correctly in the next version, not published yet

@sosukesuzuki
Copy link
Member

Duplicates to #12640

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants