Skip to content

How would this handle generic class instantiations? #2

Description

@dead-claudia

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions