Skip to content

Remove @:generic from Promise. #1846

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 1 commit into from
Dec 19, 2024
Merged

Conversation

player-03
Copy link
Contributor

This was first added in 3dad6d8, without explanation. I think it's time to remove it.

Considerations:

  • In theory, @:generic may make the code faster. However, this isn't performance-critical code, and any improvements are likely to be vanishingly small.
  • @:generic increases the size of the output.
  • @:generic prevents casting to Promise<Dynamic>, which forced a slightly more verbose implementation of FutureWork. Technically this enforces type safety, but usually we don't worry about that sort of thing. If a user's going to use Dynamic, they accept responsibility for the risks.
  • If we remove the tag, we'll be able to add static utility functions.

@skial skial mentioned this pull request Oct 31, 2024
1 task
@player-03 player-03 merged commit e3dcc36 into openfl:9.0.0-dev Dec 19, 2024
26 checks passed
@player-03 player-03 deleted the generic_Promise branch December 19, 2024 18:53
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.

1 participant