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 trivial bugs #103

Merged
merged 3 commits into from
Apr 30, 2024
Merged

Fix trivial bugs #103

merged 3 commits into from
Apr 30, 2024

Conversation

Nillerr
Copy link
Collaborator

@Nillerr Nillerr commented Apr 30, 2024

@Nillerr Nillerr merged commit bae8a59 into main Apr 30, 2024
1 check passed
@Nillerr Nillerr deleted the fix-overload-ambiguity branch April 30, 2024 15:16

override fun invokesMany(vararg blocks: () -> R) = invokesMany(blocks.map { block -> { _ -> block() } })

Choose a reason for hiding this comment

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

What is the reasoning behind removing the vararg variant?

  1. It's a breaking change in a patch version
  2. Without the vararg, every use site has to do a listOf(...) or create a helper function to polyfill the existing method.

You can see an example failure here:

TWiStErRob/net.twisterrob.travel#207 (comment)

and an example fix:

TWiStErRob/net.twisterrob.travel@e294dfa

I'm only using this in a single class, imagine a project that fully relies on this...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point @TWiStErRob! I guess I imagined nobody actually used this function since I personally didn't think it was that useful. I'll add it back in and release a hotfix for it in v2.2.2 shortly, and be more careful of retaining backward compatibility going forward, making sure to use @Deprecated warnings for future occurrences.

Choose a reason for hiding this comment

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

No worries.

Tip: write tests for these methods and it'll show you when they're useful, and whether the DX of them is good :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants