Skip to content

TS may parse type parameter lists as JSX #26179

Closed
@AlexStacker

Description

@AlexStacker

TS may mistakenly use generics as jsx,but it's ok on vscode.

TypeScript Version: 3.0.1

Search Terms:
jsx generics, class generics

Code

const a = <T = any>(): Array<T> => {
    return;
}

Expected behavior:

image

Actual behavior:
image

Playground Link:
compile errror:
https://agentcooper.github.io/typescript-play/?jsx=1#code/MYewdgzgLgBAhjAvDAPAFSfMBPAfACgEoAuGAQQCcK5t1cl6BvAWACgYOYKBTKAVwpgA3GwC+QA

but code on this is OK

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: JSX/TSXRelates to the JSX parser and emitter

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions