-
Notifications
You must be signed in to change notification settings - Fork 10
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
Compiler warning on app cldr module since 2.8.0 #35
Comments
Thanks for this report, can you tell me what other cldr modules you are using in your backend, and if you happen to alias any of them. |
This is the dependency list for ex_cldr related modules:
If you mean aliases in the app module doing |
@kipcole9 I believe that due to the nested module structure and that https://github.com/elixir-cldr/cldr_lists/blob/master/lib/cldr/list/backend.ex defmodule Cldr.List.Backend do
def define_list_module(config) do
module = inspect(__MODULE__)
backend = config.backend
config = Macro.escape(config)
quote location: :keep, bind_quoted: [module: module, backend: backend, config: config] do
defmodule List do
@moduledoc false
end
end
end
end My first thought was to write out the fully qualified name as you have done here: Elixir.List.to_tuple(), but that doesn't feel right to me, do you know if there is any other way to solve this or is this a limitation on how the modules are compiled? |
When generating code in other modules through macros, I usually fully specify module names in generated code exactly for this reason. It's easy to generate collisions and more importantly the macro user is unaware of the aliasing being done, which can have this kind of hard to pinpoint behaviour. Or you could alias with a more specific name, like |
I agree with all this; FWIW, I'm not saying this is because of an explicit |
The module nesting is deliberate for Therefore while not beautiful, either explicitly calling I'm still not clear on how the |
I've pushed a failing test here: #36. defmodule TestAllBackends.Cldr do
require Cldr.Territory.Backend
use Cldr,
default_locale: "en-001",
locales: ["en-001"],
providers: [Cldr.Calendar, Cldr.DateTime, Cldr.Language, Cldr.List, Cldr.Message, Cldr.Number, Cldr.Territory, Cldr.Unit]
end The above code produces a warning when compiled since this generated function is calling |
I guess explicitly referencing |
Thanks, I've pushed a new release. @kipcole9, let me know if you have any thoughts on what else we can do. |
On
2.8.0
a compiler warning is generated when compiling the app Cldr module:warning: MyApp.Cldr.List.wrap/1 is undefined or private
This wouldn't be a problem but is generated when compiling the app, not
ex_cldr_territories
and if you have a strict no warnings policy on your code (e.g. mix compile --warnings-as-errors) like we do it fails in CI.The text was updated successfully, but these errors were encountered: