Skip to content

Compiler error, that doesn't point to a line, which produce the error #2952

@liveforeverx

Description

@liveforeverx
defmodule Test do
  defmacrop waiting(answer, process, mref, timeout) do
    quote bind_quoted [answer: answer, process: process mref: mref, timeout: timeout] do
      receive do
        answer = reply ->
          Process.demonitor(mref, [:flush])
          reply
        {:DOWN, mref, _, _, :noconnection} ->
          exit({:nodedown, node(process)})
        {:DOWN, mref, _, _, reason} ->
          exit(reason)
      after timeout ->
        Process.demonitor(mref, [:flush])
        exit(:timeout)
      end
    end
  end
end

== Compilation error on file test.ex ==
** (ErlangError) erlang error: {:badrecord, :elixir_scope}
    (elixir) src/elixir_exp_clauses.erl:16: :elixir_exp_clauses.def/5
    (elixir) src/elixir_def.erl:160: :elixir_def.translate_definition/8
    (elixir) src/elixir_def.erl:82: :elixir_def.store_definition/9

Compiler do not give any information, where the code is wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions