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

extends infer T extends syntax fail to compile #2712

Closed
HanabishiRecca opened this issue Dec 2, 2022 · 0 comments
Closed

extends infer T extends syntax fail to compile #2712

HanabishiRecca opened this issue Dec 2, 2022 · 0 comments

Comments

@HanabishiRecca
Copy link

esbuild 0.15.16

The problem is kinda similar to #2675 and #2330, but slightly different case, so I posting it as a separate issue.

Having a such code:

type A<T> = {};
type B = {} extends infer T extends {} ? A<T> : never;

Compiles fine by tsc, but fails in esbuild with [ERROR] Expected "?" but found "extends".

BUT it compiles fine by esbuild if explicit parenthesis added:

type A<T> = {};
type B = {} extends (infer T extends {}) ? A<T> : never;

So seems like esbuild just confused about order here.

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