-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
agent macro inheritance doesn't work correctly if two types are defined in different modules with the same name #1114
Comments
In the example above which module did you use? There is no |
I would think that the |
ohh yeah there is also this other problem, since we access |
But still, what is the plan here? To check if the calling code contains the module that defined the agent? I don't know how you check whether a module has been used or not, programmatically. You can't use |
It should be built at runtime so that we can obtain the module location of the variable e.g. julia> module A
export X
struct X end
end;
julia> using .A
julia> macro m(x)
quote parentmodule($x) end
end;
julia> @m(X)
Main.A |
and the book-keeping should be like julia> Agents.__AGENT_GENERATOR__
Dict{Symbol, Expr} with 8 entries:
(Agents, :GraphAgent) => :(mutable struct GraphAgent <: Agents.AbstractAgent…
(Agents, :GridAgent) => :(mutable struct GridAgent{D} <: Agents.AbstractAgent…
(A, :X) => :(mutable struct X <: Agents.AbstractAgent…
(B, :X) => :(mutable struct X <: Agents.AbstractAgent…
(Main, :Y) => :(mutable struct Y <: Agents.AbstractAgent…
... |
E.g. something like
That is because our book-keeping doesn't preserve the module where the inherited agent belongs to:
The text was updated successfully, but these errors were encountered: