Open pjambet opened 8 years ago
Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!
Here is what to expect next, and if anyone wants to comment, keep these things in mind.
I got this exact problem while working on https://guide.elm-lang.org/architecture/effects/random.html. A note should be added to this page in particular to signal to new Elm developers this potential name collision issue.
EDIT: Opened a PR to address this here https://github.com/evancz/guide.elm-lang.org/pull/67
Hi,
I was working through the online tutorial, and when playing with the random example, I stumbled upon a weird compiler issue when trying to run the file through
elm-reactor
I realized the file I was trying to run was named
random.elm
, which seems to cause a conflict when if the file contains the lineimport Random
.It took me a few minutes to understand what was happening (mostly because I'm an absolute beginner and don't know much about elm), but based on the excellent compiler error that elm uses, I thought that this could be something that could be improved.
It seems like if one of the
import
statements matches the current file, a warning (or an error) could be issued. We could also maybe make the linedirectory ././Random.elm
a little bit more explicit to illustrate that it references the current file.Those are just my current thoughts, there could obviously be better options.
I would be happy to work on those improvements (if they are deemed valid), but I'm not exactly sure how the compiler really works. All I found so far is this file, that seems to be involved in the process. It could be a good reason for me to start learning some haskell!
PS: Really loving elm so far, thank you so much for everything!
Using elm 0.17.0 on mac OS