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

How would this handle generic class instantiations? #2

Open
dead-claudia opened this issue Dec 3, 2020 · 0 comments
Open

How would this handle generic class instantiations? #2

dead-claudia opened this issue Dec 3, 2020 · 0 comments

Comments

@dead-claudia
Copy link

A major point of conflict between TS/Flow and the ES spec is with generic type instantiation:

let foo = new Foo<T>(1)

That production is parsed by TS and Flow to be a single constructor call, but it's also valid ES, equivalent to the following:

((new Foo) < T) > 1

IMHO, breaking the below code is a non-issue as I very highly doubt anyone is relying on that behavior (and it's easy for browsers to collect usage metrics on, too), but it's still worth mentioning as a potential risk. It also will tremendously complicate any grammar specification for it, requiring probably multiple cover grammars.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant