Skip to content

fix: Remove redundant InferReturn<T> #1338

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

Merged
merged 2 commits into from
Jun 9, 2025
Merged

Conversation

iwoplaza
Copy link
Collaborator

@iwoplaza iwoplaza commented Jun 5, 2025

No description provided.

Copy link

github-actions bot commented Jun 5, 2025

pkg.pr.new

packages

pnpm i https://pkg.pr.new/software-mansion/TypeGPU/typegpu@1338
pnpm i https://pkg.pr.new/software-mansion/TypeGPU/typegpu@b3096091ff7709b6488ea7907ee71a2a5d4a2706

benchmark
view benchmark

commit
view commit

Copy link
Contributor

@mhawryluk mhawryluk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well yes! thanks 🫧

Copy link
Contributor

@aleksanderkatan aleksanderkatan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good cleanup!

Args extends unknown[] | Record<string, unknown> =
| unknown[]
| Record<string, unknown>,
Args extends unknown[] | [] = unknown[] | [],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't unknown[] | [] equivalent to unknown[]? There is no type error when I change the type to Args extends unknown[] = unknown[]

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's different from TS's point of view in specific scenarios, e.g., when inferring a tuple type. The change here is done for consistency reasons, as removing | [] in the definition of Implementation instead does cause a type error.

@iwoplaza iwoplaza merged commit 00f8b62 into main Jun 9, 2025
6 checks passed
@iwoplaza iwoplaza deleted the fix/cleanup-infer-return branch June 9, 2025 09:12
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.

3 participants