Having a non-concrete field in a struct
is indeed bad for performance. However, you could do
abstract type SuperFoo end
struct Bar{T <: SuperFoo}
b::T
end
struct Foo <: SuperFoo
b::Bar
end
Having a non-concrete field in a struct
is indeed bad for performance. However, you could do
abstract type SuperFoo end
struct Bar{T <: SuperFoo}
b::T
end
struct Foo <: SuperFoo
b::Bar
end