elixir
elixir copied to clipboard
Spec errors are reported at first line of file
defmodule Example do
@spec plus1(integer) :: integer
def plusone(x) do
x + 1
end
end
Gives an error message:
** (CompileError) test.ex:1: spec for undefined function 'Elixir.Example':plus1/1
lists.erl:1313: :lists.foreach/2
/home/peter/git/elixir/lib/elixir/lib/code.ex:291: Code.require_file/2
/home/peter/git/elixir/lib/elixir/lib/kernel/cli.ex:303: Kernel.CLI.process_command/2
The error is reported at the first line of the file instead of the line where the spec is at. This makes vim+syntastic show the error at the wrong position in the file.
I assume this has something to do with the error apparently coming from Erlang instead of being handled by Elixir.