Hi friends,
I’m working on a library that “writes code,” and am wondering if there is a public interface to all aliases available in the macro environment.
For instance, if some argument evaluates to a struct %Foo.Bar.Baz{}
, and the calling module has aliased Baz
using alias Foo.Bar.Baz
, I want to know that %Baz{}
can be used.
This information is available via __CALLER__.aliases
, but the docs explicitly call this (and other fields) out as private.
There is a fetch_alias
that works the other way, expanding a potential alias to a fully qualified name, but I cannot find a way to go from fully qualified to available alias. I wanted to check whether I’m missing something before proposing a public API.