Skip to content

jgallinari/ex_issue_12110

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ex_issue_12110

Basic sample to illustrate how to reproduce Elixir issue #12110

Steps

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/support

Update mix.exs to include test/support in :elixirc_paths

  • Add file test/ex_issue12110_test.exs
  • Add file test/support/helper.ex

How to reproduce the issue

❯ 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/2

Description

test/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
  end

If we remove the line:

            @test test

no 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.

About

How to reproduce Elixir issue #12110

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages