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

Module name collision in generated code #826

Closed
evancz opened this issue Nov 11, 2014 · 4 comments
Closed

Module name collision in generated code #826

evancz opened this issue Nov 11, 2014 · 4 comments

Comments

@evancz
Copy link
Member

evancz commented Nov 11, 2014

As it is, each module is attached to Elm according to its name, so Search.View becomes Elm.Search.View.

This becomes problematic when there are many packages involved that may have modules with the same names. For example, if there's a private Utils module in evancz/focus and in evancz/automaton, the module that wins at runtime depends on what order things were compiled.

The solution is to use fully qualified names in generated code, so Utils would be Elm.evancz.focus.Utils or something like that.

@joaalto
Copy link

joaalto commented Mar 22, 2016

I just ran into a module name collision. I'm using rluiten/elm-date-extra in an hour reporting app I'm writing. Then I needed some UI components and decided to bring in Elm-UI. Unfortunately this doesn't work, as Elm-UI depends on mgold/elm-date-format, and both elm-date-format and elm-date-extra have a module called Date.Format:

I found multiple modules named 'Date.Format'.

Module 'Ui.DatePicker' is trying to import it.

Modules with that name were found in the following locations:

    package mgold/elm-date-format
    package rluiten/elm-date-extra

@evancz
Copy link
Member Author

evancz commented May 12, 2016

Whoo, resolved in 0.17!

@evancz evancz closed this as completed May 12, 2016
@szagi3891
Copy link

how can use it?

@evancz
Copy link
Member Author

evancz commented Aug 3, 2017

To clarify, the initial issue was that if two packages have private modules with the same name, it used to cause problems. So if package tom/array had a Utils module that was not exposed, and if package sue/animation had a Utils module that was not exposed, it would mess up. That problem was fixed.

@joaalto posted about a separate issue, thinking this was tracking what he was worried about. That happens, and that is why I recommend always opening a new issue rather than piling on things that you think are your problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants