elixir icon indicating copy to clipboard operation
elixir copied to clipboard

Macro.escape doesn't handle HashDicts

Open betawaffle opened this issue 13 years ago • 1 comments

The problem seems to be coming from the cons cells used by HashDict.

HashDict.new(a: 1, b: 2, c: 3) |> Macro.escape

Which results in:

** (FunctionClauseError) no function clause matching in :lists.reverse/1
    lists.erl:145: :lists.reverse([:c | 3])
    src/elixir_quote.erl:203: :elixir_quote.do_quote/3
    src/elixir_quote.erl:263: :elixir_quote.do_splice/5
    src/elixir_quote.erl:199: :elixir_quote.do_quote/3
    /builddir/build/BUILD/elixir-0.10.0/lib/elixir/lib/macro.ex:76: Macro.escape/2
    erl_eval.erl:569: :erl_eval.do_apply/6
    src/elixir.erl:147: :elixir.eval_forms/3
    /builddir/build/BUILD/elixir-0.10.0/lib/elixir/lib/code.ex:111: Code.do_eval_string/3

See elixir_quote.erl

betawaffle avatar Aug 23 '13 17:08 betawaffle

I'll give this a go.

pminten avatar Aug 24 '13 07:08 pminten