[erlang-questions] Compile Question

Michael Schmidt Michael.K.Schmidt@REDACTED
Tue Dec 4 19:44:09 CET 2018


I have been chasing a compile error:
** (CompileError) elixir_compiler_1: function '__MODULE__'/1+17:
  An implementation limit was reached.
  Try reducing the complexity of this function.

  Instruction: {move,{x,0},{y,1555}}

    (stdlib) lists.erl:1338: :lists.foreach/2
    lib/absinthe/phase/schema/compile.ex:51: Absinthe.Phase.Schema.Compile.run/2
    lib/absinthe/pipeline.ex:283: Absinthe.Pipeline.run_phase/3
    lib/absinthe/schema.ex:214: Absinthe.Schema.__after_compile__/2
    (stdlib) lists.erl:1263: :lists.foldl/3
    (stdlib) erl_eval.erl:680: :erl_eval.do_apply/6
    (elixir) lib/kernel/parallel_compiler.ex:206: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/6

I realize this is an Elixir / Absinthe issue, but my question is this:  How is lists:foreach() able to trigger this?
https://github.com/erlang/otp/blob/master/lib/stdlib/src/lists.erl#L1332

Poking around, there is indeed a list of 776 items that generates 2 function defs each, which gives us a final AST list of approx 1552.  I assume this is related to the {y,1555} in Error.

Can lists:each() not handle lists longer than 1024?  What am I missing?

Thanks!
Mike






-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20181204/24983188/attachment.htm>


More information about the erlang-questions mailing list