Closed
Description
Elixir and Erlang/OTP versions
Erlang/OTP 27 [erts-15.2.3] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit]
Elixir 1.18.3 (compiled with Erlang/OTP 27)
Operating system
any
Current behavior
Given a compile tracer
defmodule MyTracer do
def trace(event, _env) do
dbg(event)
:ok
end
end
Code.put_compiler_option(:tracers, [MyTracer])
- super call does not emit any events
defmodule OverFunCall do
def fun(x) do
1
end
defoverridable [fun: 1]
def fun(x) do
super(x)
end
end
&super/n
capture does not emit any events
defmodule OverFunCapture1 do
def fun(x) do
1
end
defoverridable [fun: 1]
def fun(x) do
Enum.map([], &super/1)
end
end
&super(&1)
call inside capture generates a local_function event
defmodule OverFunCapture2 do
def fun(x) do
1
end
defoverridable [fun: 1]
def fun(x) do
Enum.map([], &super(&1))
end
end
[iex:12: MyTracer.trace/2]
event #=> {:local_function, [line: 9, column: 19], :"fun (overridable 1)", 1}
- For defmacro neither of the cases emits any events
Expected behavior
There is a couple of options here
super
emits consistentlocal_(function|macro)
events in all cases - not ideal as it exposes not documented implementation detail:"fun (overridable 1)"
- no events emitted at all - not ideal as we emit local calls in other case
- A new event category
super_(function|macro)
Metadata
Metadata
Assignees
Labels
No labels