You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
iex <<__EOF__defmodule Foo do def bar() do super = 1 super endend__EOF__
Gives an error that looks like something went wrong inside the compiler:
** (FunctionClauseError) no function clause matching in :lists.mapfoldl/3
The following arguments were given to :lists.mapfoldl/3:
# 1
#Function<4.86030924/2 in :elixir_erl_pass.translate_args/2>
# 2
{:elixir_erl, :match, nil, false, %{}, %{}, [], %{}, false}
# 3
nil
(stdlib) lists.erl:1353: :lists.mapfoldl/3
This code does compile on an older Elixir 1.8.2 (compiled with Erlang/OTP 21) without errors:
docker run --rm -i elixir:1.8.2 iex <<__EOF__defmodule Foo do def bar() do super = 1 super endend__EOF__
For a little more information, this appears to be an issue with super (probably in the compilation of overridable functions).
Erlang/OTP 21 [erts-10.3.4] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [hipe]
Interactive Elixir (1.9.0) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> defmodule Foo do
...(1)> def bar() do
...(1)> super = 1
...(1)> end
...(1)> end
warning: variable "super" is unused (if the variable is not meant to be used, prefix it with an underscore)
iex:3: Foo.bar/0
** (FunctionClauseError) no function clause matching in :lists.mapfoldl/3
The following arguments were given to :lists.mapfoldl/3:
# 1
#Function<4.91218841/2 in :elixir_erl_pass.translate_args/2>
# 2
{:elixir_erl, :match, nil, false, %{}, %{}, [], %{}, false}
# 3
nil
(stdlib) lists.erl:1353: :lists.mapfoldl/3
iex(1)> defmodule Foo do
...(1)> def bar() do
...(1)> supe = 1
...(1)> end
...(1)> end
warning: variable "supe" is unused (if the variable is not meant to be used, prefix it with an underscore)
iex:3: Foo.bar/0
{:module, Foo,
<<70, 79, 82, 49, 0, 0, 4, 36, 66, 69, 65, 77, 65, 116, 85, 56, 0, 0, 0, 121,
0, 0, 0, 13, 10, 69, 108, 105, 120, 105, 114, 46, 70, 111, 111, 8, 95, 95,
105, 110, 102, 111, 95, 95, 7, 99, 111, ...>>, {:bar, 0}}
Environment
Current behavior
Running this:
Gives an error that looks like something went wrong inside the compiler:
This code does compile on an older Elixir 1.8.2 (compiled with Erlang/OTP 21) without errors:
Expected behavior
Either this code compiles without errors (as it does on an older Elixir 1.8.2) or a readable compilation error is raised.
The text was updated successfully, but these errors were encountered: