Description
Elixir and Erlang/OTP versions
Erlang/OTP 27 [erts-15.2.5] [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
The following code example when a call on attribute happens inside module body do not emit remote_function
tracer events
defmodule Foo do
@x Enum
@x.count([])
end
Only alias_reference
is emitted here.
Compare that with the call in function body which emits the event
defmodule Foo do
@x Enum
def go do
@x.count([])
end
end
Or indirect call
defmodule Foo do
Enum.count([])
end
Similarly, a capture call will not emit the event in module body
defmodule Foo do
@x (&Enum.count/1)
@x.([])
end
defmodule Foo do
import Enum
@x (&count/1)
@x.([])
end
But will emit in function body
defmodule Foo do
@x (&Enum.count/1)
def go do
@x.([])
end
end
Additionally, if a module variable is used instead of an attribute the same bahaviour can be observed - no trace events emitted
defmodule Foo do
x = Enum
x.count([])
end
defmodule Foo do
x = (&Enum.count/1)
x.([])
end
As far as I can tell, the compile time dependencies are correctly set
Expected behavior
The calls in the examples with attributes should emit tracer events. I'm not sure about the calls on module variable.