Permalink
Browse files

Simply let unhandled -> fail, closes #315

  • Loading branch information...
1 parent 1acad9e commit 9947f6a405e1e18fff42d3c14d65177cc20f57e5 @josevalim josevalim committed May 31, 2012
Showing with 0 additions and 14 deletions.
  1. +0 −9 src/elixir_translator.erl
  2. +0 −5 test/elixir/elixir/errors_test.exs
@@ -44,15 +44,6 @@ translate_each({ '__block__', Line, Args }, S) when is_list(Args) ->
{ TArgs, NS } = translate(Args, S),
{ { block, Line, TArgs }, NS };
-translate_each({ '->', Line, _ }, S) ->
- case S#elixir_scope.macro of
- [] -> % TODO: This shuold be raised at runtime
- syntax_error(Line, S#elixir_scope.filename, "use of -> out of context", "");
- [{ _Line, Receiver, Name, Arity }|_] ->
- Desc = [elixir_errors:inspect(Receiver), Name, Arity],
- syntax_error(Line, S#elixir_scope.filename, "use of -> out of context in macro ~s.~s/~B", Desc)
- end;
-
%% Erlang op
translate_each({ '__op__', Line, [Op, Expr] }, S) when is_atom(Op) ->
@@ -59,11 +59,6 @@ defmodule Elixir.ErrorsTest do
assert "nofile:1: invalid args for fn" == format_rescue 'fn 1'
end
- test :unproper_macro do
- assert "nofile:4: use of -> out of context in macro Elixir.ErrorsTest.UnproperMacro.unproper/1" ==
- format_rescue 'defmodule Foo do\nrequire Elixir.ErrorsTest.UnproperMacro\nElixir.ErrorsTest.UnproperMacro.unproper do\n1 -> 3\nend\nend'
- end
-
test :macro_conflict do
assert "nofile:1: imported Elixir.Builtin.defrecord/2 conflicts with local function" ==
format_rescue 'defmodule Foo do\ndefrecord(Elixir.ErrorsTest.MacroConflict, a: 1)\ndef defrecord(_, _), do: OMG\nend'

0 comments on commit 9947f6a

Please sign in to comment.