Request for improved error message

== Compilation error on file lib/as2v002/as1_proxy_plug.ex ==
** (SyntaxError) lib/as2v002/as1_proxy_plug.ex:276: unexpected token: end
    (elixir) lib/kernel/parallel_compiler.ex:116: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/1

So 276 is the last line. There’s either an extra end somewhere, or some other spurious “close” of an expression. As someone still mastering Elixir, I find that this is the one & only error message I get that is not helpful for me to find the source of error. Is there any way that the compiler could in this situation look back at each span between def (or defp) to analyze which one prematurely closed out the module?

It can be very difficult to automatically ‘solve’ such a thing of error, though not infeasible.

What I do is rely on my editors highlighted closing matches, so if I hover over that last end and see where it is closing then I can just work around that.

1 Like