Dialyzer: overlapping domains when adding ex_cldr_calendars
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
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?
Can you share the call to
Transport.Cldr.Calendar.localize/3that 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.
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.
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?
Ping @ptitfred ?
Ping @ptitfred ?
Sorry, my GitHub notifications were mis configured. Let me get back to you later today.
Can you think of anything you
ex_cldr_calendarsyou 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.
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.
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,