Hi,
The error messages produced by Erlang/Elixir on a module name case mismatch
when using a case-insensiteve FS can be confusing/intimidating:
iex(1)> Genserver.start_link(MyApp.Worker, [], name: MyApp.Worker)
09:57:03.286 [error] Loading of /lib/elixir/ebin/Elixir.Genserver.beam
failed: :badfile
09:57:03.287 [error] beam/beam_load.c(1376): Error loading module
'Elixir.Genserver':
module name in object code is Elixir.GenServer
** (UndefinedFunctionError) function Genserver.start_link/3 is undefined
(module Genserver is not available)
Genserver.start_link(MyApp.Worker, [], [name: MyApp.Worker])
The :code_server logs in particular can send even an experienced developer
down a rabbit hole, looking for a problem with the BEAM file.
I made a PR to detect this particular issue, and improve the error message
with a helpful suggestion ("Did you mean...?"):
https://github.com/elixir-lang/elixir/pull/5665
Unfortunately the tests fail on Travis CI, presumably because it uses a
case-sensitive FS. Which raises the question: should the suggestion be
included in that case as well? My current implementation cannot support
that. I see two options:
1. Keep the proposed implementation, because only case-insensitive FS users
will see those confusing :code_server logs; the tests would have to be made
conditional, to avoid failures on case-sensitive systems
2. Make the implementation more generic, to provide "Did you mean...?"
suggestions for any module typos.
Any thoughts...?
Thanks,
Bram
--
You received this message because you are subscribed to the Google Groups
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elixir-lang-core/5be5f9a9-0370-4ee8-bb57-e948f6c877c3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.