elixir-cldr / cldr

Elixir implementation of CLDR/ICU
Other
440 stars 33 forks source link

Typespec of do_plural_rule might not match success typing when using extra_returns #219

Closed Munksgaard closed 9 months ago

Munksgaard commented 9 months ago

Similar to https://github.com/elixir-cldr/cldr_numbers/issues/44 and https://github.com/elixir-cldr/cldr_currencies/issues/11, Cldr can cause issues for projects that have the extra_returns option for dialyzer enabled.

The issue (as I understand it) is that the return type of do_plural_rule depends on the specific locale used. Therefore, we cannot statically determine the correct typespec. At the same, accurately describing the possible values that might be returned is valuable, so we would like to keep the typespec in place. Therefore, a solution might be to silence warnings for this particular function.