Bad parsing behaviour for generic arrow type arguments in class heritage / JSX open element · Issue #47410 · microsoft/TypeScript · GitHub
Skip to content

Bad parsing behaviour for generic arrow type arguments in class heritage / JSX open element #47410

Description

Bug Report

🔎 Search Terms

shift left
type arguments
<<

🕗 Version & Regression Information

  • This is a crash
  • This changed between versions ______ and _______
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about ____ Generics _____
  • I was unable to test this on prior versions because _______

⏯ Playground Link

Playground link with relevant code

💻 Code

// No parse error.
(class extends f()< <T>(x: T) => T> {});
<Component< <T>(x: T) => T> />;

// Parse error.
(class extends f()<<T>(x: T) => T> {});
<Component<<T>(x: T) => T> />;

🙁 Actual behavior

Parsing error.

🙂 Expected behavior

No parse error. They are equivalent.

Additional Info

Found this issue when working on a similar fix to Babel (babel/babel#14145). This issue is a follow-up to #23996. /cc Wenlu Wang (@Kingwl) since you have fixed that issue.

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

    BugA bug in TypeScriptDomain: ParserThe parser didn't handle the syntax correctlyHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions