Thanks @WschW, that’s got me on the right track. I’m happy to just support unqualified types, but will need to cover a specific parametric type.
GridAgent{Int} and ContinuousAgent{Int}. I’ll take a look at that myself soon, but if you know a nice way to build the type signatures, that’d be really helpful.
Current (not working) progress:
if hasfield(typeof(base), :args)
# This option assumes only one parametric
# type for dimensionality. Will need to be
# modified for more complex types.
base_type = getfield(@__MODULE__, base.args[1])
base_types = collect(base_type.body.types) #<-- These are not currently appropriate. Need to incorporate args[2]
else
base_type = getfield(@__MODULE__, base)
base_types = collect(base_type.types)
end
base_fieldnames = fieldnames(base_type)