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

fix(parser): handle empty type parameters and conditional union/intersection bugfix #9964

Merged
merged 3 commits into from
Apr 5, 2024

Conversation

dylan-conway
Copy link
Collaborator

@dylan-conway dylan-conway commented Apr 5, 2024

What does this PR do?

Fixes a bug when parsing unions or intersections with infer extends ternary.

var bar: Bar extends string | infer Bar extends string ? Bar : never;
var bar: Bar extends string & infer Bar extends string ? Bar : never;

fixes #9959

Allows parsing empty type parameters for interfaces and types. Inspired by this pr in esbuild evanw/esbuild#3513

interface Foo<> {};
type Bar<> = {};

How did you verify your code works?

added some tests

Copy link
Contributor

github-actions bot commented Apr 5, 2024

Copy link
Contributor

github-actions bot commented Apr 5, 2024

Copy link
Contributor

github-actions bot commented Apr 5, 2024

@dylan-conway 2 files with test failures on bun-darwin-aarch64:

View test output

#6878663ea64783647b7c83d86cd6b105fedfe7a4

Copy link
Contributor

github-actions bot commented Apr 5, 2024

@Jarred-Sumner Jarred-Sumner merged commit 182b908 into main Apr 5, 2024
24 of 30 checks passed
@Jarred-Sumner Jarred-Sumner deleted the dylan/typescript-empty-params branch April 5, 2024 07:45
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

Successfully merging this pull request may close these issues.

Bun fails to parse complex TypeScript generics when running tests
2 participants