Basic sample to illustrate how to reproduce Elixir issue #12110
The steps done to create this sample were:
- Create project
❯ mix new ex_issue_12110- Add test/support directory
❯ cd ex_issue_12110
❯ mkdir test/supportUpdate mix.exs to include test/support in :elixirc_paths
- Add file test/ex_issue12110_test.exs
- Add file test/support/helper.ex
❯ mix test
Compiling 1 file (.ex)
== Compilation error in file test/ex_issue12110_test.exs ==
** (CompileError) elixir_compiler_1:1: function '-__MODULE__/1-fun-0-'/2+6:
Internal consistency check failed - please report this bug.
Instruction: {get_map_elements,
{f,28},
{x,0},
{list,
[{atom,url},
{x,3},
{atom,func},
{x,3},
{atom,desc},
{x,2}]}}
Error: conflicting_destinations:
(stdlib 4.0.1) lists.erl:1442: :lists.foreach_1/2test/ex_issue12110_test.exs calls a macro supposed to generate test cases from constant @tests.
ExIssue12110.Helper.generate_tests(@tests)This macro is
defmacro generate_tests(external_tests) do
quote do
for [category: category, tests: tests] <- unquote(external_tests) do
describe "#{category}" do
for %{desc: desc, func: _, url: _} = test <- tests do
@test test
test "#{desc}" do
assert true
end
end
end
end
end
endIf we remove the line:
@test testno more issue.
If we change the line
for %{desc: desc, func: _, url: _} = test <- tests do
into
for %{desc: desc, func: _} = test <- tests do
no more issue either.