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

ex_cldr_territories 2.2.0 fails dialyzer checks #14

Closed
simoncocking opened this issue May 10, 2021 · 3 comments
Closed

ex_cldr_territories 2.2.0 fails dialyzer checks #14

simoncocking opened this issue May 10, 2021 · 3 comments

Comments

@simoncocking
Copy link

Upgrading from 2.1.0, which passed Dialyzer fine. 2.2.0 produces this:

lib/myapp/cldr.ex:1: Invalid type specification for function 'Elixir.MyApp.Cldr.Territory':'from_subdivision_code!'/2. The success typing is (binary() | #{'__struct__':='Elixir.Cldr.LanguageTag', 'backend':=atom(), 'canonical_locale_name':=binary(), 'cldr_locale_name':='nil' | binary(), 'extensions':=map(), 'gettext_locale_name':='nil' | binary(), 'language':=binary(), 'language_subtags':=[binary()], 'language_variant':='nil' | binary(), 'locale':=map(), 'private_use':=[binary()], 'rbnf_locale_name':='nil' | binary(), 'requested_locale_name':=binary(), 'script':='nil' | binary(), 'territory':=atom(), 'transform':=map()},[{'locale',binary() | #{'__struct__':='Elixir.Cldr.LanguageTag', 'cldr_locale_name':='nil' | binary() | map(), _=>_}},...]) -> <<_:16,_:_*8>>
done in 0m33.77s
lib/myapp/cldr.ex:1: Invalid type specification for function 'Elixir.MyApp.Cldr.Territory':'translate_subdivision!'/3. The success typing is (binary(),#{'__struct__':='Elixir.Cldr.LanguageTag', 'cldr_locale_name':=binary() | #{'__struct__':='Elixir.Cldr.LanguageTag', 'backend':=atom(), 'canonical_locale_name':=binary(), 'cldr_locale_name':='nil' | binary(), 'extensions':=map(), 'gettext_locale_name':='nil' | binary(), 'language':=binary(), 'language_subtags':=[binary()], 'language_variant':='nil' | binary(), 'locale':=map(), 'private_use':=[binary()], 'rbnf_locale_name':='nil' | binary(), 'requested_locale_name':=binary(), 'script':='nil' | binary(), 'territory':=atom(), 'transform':=map()}, _=>_},binary() | #{'__struct__':='Elixir.Cldr.LanguageTag', 'backend':=atom(), 'canonical_locale_name':=binary(), 'cldr_locale_name':='nil' | binary(), 'extensions':=map(), 'gettext_locale_name':='nil' | binary(), 'language':=binary(), 'language_subtags':=[binary()], 'language_variant':='nil' | binary(), 'locale':=map(), 'private_use':=[binary()], 'rbnf_locale_name':='nil' | binary(), 'requested_locale_name':=binary(), 'script':='nil' | binary(), 'territory':=atom(), 'transform':=map()}) -> {'error',{'Elixir.Cldr.UnknownLocaleError',<<_:64,_:_*8>>} | {'Elixir.Cldr.UnknownSubdivisionError',<<_:64,_:_*8>>}}
lib/cldr/backend.ex:277: The call 'Elixir.MyApp.Cldr.Territory':from_subdivision_code(_@4::atom() | binary(),_@5::'nil' | binary()) breaks the contract ('Elixir.Cldr.Territory':binary_tag(),[{'locale','Elixir.Cldr.Territory':binary_tag()}]) -> {'ok',binary()} | {'error','Elixir.Cldr.Territory':error()}
lib/cldr/backend.ex:523: The pattern {'ok', _@6} can never match the type {'error',{'Elixir.Cldr.UnknownLocaleError',<<_:64,_:_*8>>} | {'Elixir.Cldr.UnknownSubdivisionError',<<_:64,_:_*8>>}}
lib/cldr/backend.ex:896: The call 'Elixir.MyApp.Cldr.Territory':from_subdivision_code(_@5::<<_:16,_:_*8>>,_@3::<<_:16,_:_*16>>) breaks the contract ('Elixir.Cldr.Territory':binary_tag(),[{'locale','Elixir.Cldr.Territory':binary_tag()}]) -> {'ok',binary()} | {'error','Elixir.Cldr.Territory':error()}
done (warnings were emitted)
Halting VM with exit status 2
@Schultzer
Copy link
Collaborator

Thanks for reporting this, I'll take a look, and hopefully I can address this soon.

@Schultzer
Copy link
Collaborator

This should be fixed in a96171f, I'll see if I can get the CI to run a dialyzer workflow before releasing a new version, meanwhile you can use master.

@Schultzer
Copy link
Collaborator

Closed in https://github.com/Schultzer/cldr_territories/releases/tag/v2.2.1

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

No branches or pull requests

2 participants