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

Dialyzer: overlapping domains when adding ex_cldr_calendars #241

Open
ptitfred opened this issue Sep 17, 2024 · 9 comments
Open

Dialyzer: overlapping domains when adding ex_cldr_calendars #241

ptitfred opened this issue Sep 17, 2024 · 9 comments

Comments

@ptitfred
Copy link

When adding duration formatting to an existing elixir application, I've encountered this dialyzer error:

lib/cldr.ex:1:overlapping_contract
Overloaded contract for Transport.Cldr.Calendar.localize/3 has
overlapping domains; such contracts are currently unsupported and
are simply ignored.

The lib/cldr.ex module is defined here, following closely the instructions as you can see.

I've tried disabling this rule without any luck, and in last resort I've disabled the whole module in the .dializer_ignore.exs file.

If needed, here are the pinned dependencies related to cldr:

  • cldr_utils: 2.28.0 e7ac4bce
  • ex_cldr: 2.40.0 113394b6
  • ex_cldr_calendars: 1.26.2 b689847f
  • ex_cldr_currencies: 2.16.2 2ccfac28
  • ex_cldr_lists: 2.11.1 00161c04
  • ex_cldr_numbers: 2.33.2 49f1dbad
  • ex_cldr_units: 3.17.2 457d76c6

Please let me know if I can help you with it, or if I can test some fix attempt later on.

Cheers

@kipcole9
Copy link
Collaborator

Can you share the call to Transport.Cldr.Calendar.localize/3 that is triggering this warning? I have a number of calls to that function in my test environment specifically because there used to be some dialyzer warnings - but that hasn't been observed in some time. That why I wonder if your specific call triggers something I've not seen before.

There are quite a few dialyzer-related improved in ex_cldr version 2.40.1 but I don't think these should be related to triggering this warning. But to be sure, perhaps you could test with that version?

@ptitfred
Copy link
Author

Can you share the call to Transport.Cldr.Calendar.localize/3 that is triggering this warning? I have a number of calls to that function in my test environment specifically because there used to be some dialyzer warnings - but that hasn't been observed in some time. That why I wonder if your specific call triggers something I've not seen before.

That's the tricky part: we don't call it :/

There are quite a few dialyzer-related improved in ex_cldr version 2.40.1 but I don't think these should be related to triggering this warning. But to be sure, perhaps you could test with that version?

I can give it a try for sure.

@ptitfred
Copy link
Author

There are quite a few dialyzer-related improved in ex_cldr version 2.40.1 but I don't think these should be related to triggering this warning. But to be sure, perhaps you could test with that version?

It didn't solve it I'm afraid.

@kipcole9
Copy link
Collaborator

Hmmm, I'm a bit out of ideas. The primary consumer of MyApp.Cldr.Calendar.localize/3 is ex_cldr_dates_times but that's not a library you are using.

Can you think of anything you ex_cldr_calendars you are using that would ultimately localise the name of months or days? I know thats not a lot of guidance but I'm out of ideas.

One last thought, can you share what flags you are setting for dialyzer? I am testing with:

        flags: [
          :error_handling,
          :unknown,
          :underspecs,
          :extra_return,
          :missing_return
        ]

but perhaps you have a broader configuration?

@kipcole9
Copy link
Collaborator

Ping @ptitfred ?

@ptitfred
Copy link
Author

Ping @ptitfred ?

Sorry, my GitHub notifications were mis configured. Let me get back to you later today.

@ptitfred
Copy link
Author

Can you think of anything you ex_cldr_calendars you are using that would ultimately localise the name of months or days? I know thats not a lot of guidance but I'm out of ideas.

That's the tricky part: we weren't using it before it. I'm out of ideas as well :/

One last thought, can you share what flags you are setting for dialyzer? I am testing with:

No flags explicitly configured. We're using dialyxir 1.4.3.


I guess I can live with the warning being disabled for this one module.

@kipcole9
Copy link
Collaborator

Mmmm, then I guess I'm out of ideas for now. I've done a lot of work on dialyzer, and specifically on that module and function. And I can't find a way to trigger the warning you're seeing.

I'll keep this issue open as I go through the CLDR 46 development process in October, just in case something becomes more obvious.

@ptitfred
Copy link
Author

Thank you @kipcole9.

I'm sorry I had to report this to you. I'm ok with disabling dialyzer on this module, not a big deal.

Cheers,

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