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

Silence dialyzer warnings about do_plural_rule #220

Merged
merged 1 commit into from Nov 2, 2023

Conversation

Munksgaard
Copy link
Contributor

Libraries that depend on Cldr might use the :extra_returns feature in dialyzer, which will warn if the typespec of a function specifies return types that are not part of the success typing.

My understanding is that the behavior (and therefore success typing) of do_plural_rule depends/8 on the locale used, so we cannot accurately tell what the correct return type is. Therefore, this commit posits to silence dialyzer warnings about do_plural_rule/8.

Fixes #219

Libraries that depend on Cldr might use the `:extra_returns` feature in dialyzer, which will warn if the typespec of a function specifies return types that are not part of the success typing.

My understanding is that the behavior (and therefore success typing) of `do_plural_rule depends/8` on the locale used, so we cannot accurately tell what the correct return type is. Therefore, this commit posits to silence dialyzer warnings about `do_plural_rule/8`.
@Munksgaard
Copy link
Contributor Author

Munksgaard commented Oct 26, 2023

Ideally, we should use :no_extra_return instead of disabling all warnings, but that is not currently possible in elixir, due to this bug.

@kipcole9 kipcole9 merged commit 3b209a1 into elixir-cldr:main Nov 2, 2023
1 check passed
@kipcole9
Copy link
Collaborator

kipcole9 commented Nov 2, 2023

Sorry for the delay, much appreciated. I will be publishing a new release to hex soon to also ensure Elixir 1.16 there are no warnings.

🥳🥳🥳🥳🥳

kipcole9 added a commit that referenced this pull request Nov 2, 2023
Silence dialyzer warnings about do_plural_rule
@kipcole9
Copy link
Collaborator

kipcole9 commented Nov 2, 2023

I've published ex_cldr version 2.37.5 with the following changelog entry:

Bug Fixes

Thanks again!

@Munksgaard Munksgaard deleted the patch-1 branch November 2, 2023 06:25
@Munksgaard
Copy link
Contributor Author

No, thank you for the great work you've put into the cldr-project!

@kipcole9
Copy link
Collaborator

kipcole9 commented Nov 2, 2023

Thanks for the kind words Philip, I appreciate it.

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.

Typespec of do_plural_rule might not match success typing when using extra_returns
2 participants