Skip to content

[tsx] <T extends U></T>; is not parsed correctly #47355

@nicolo-ribaudo

Description

@nicolo-ribaudo

Bug Report

🔎 Search Terms

jsx extends ambiguity type parameters

🕗 Version & Regression Information

I only tested 4.5.4 and Nighty on the repl

  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about "JSX and React"

⏯ Playground Link

Playground link with relevant code

💻 Code

// This works
<T implements U></T>;

// This doesn't
<T extends U></T>;

🙁 Actual behavior

The second JSX expression is parsed as a malformed arrow function

🙂 Expected behavior

Both are valid JSX elements

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions