CompositeStructs.jl
CompositeStructs.jl copied to clipboard
default initialisers in parametric parent types that refer to the type parameter lead to error in constructor call
MWE:
@kwdef struct Foo{T}
x :: Int = sizeof(T)
end
@composite @kwdef struct Bar
Foo{Int}...
end
Calling Bar()
errors with "UndefVarError: T
not defined".
The problem seems to be that the keyword constructor @composite
generates calls Foo(...)
instead of Foo{Int}(...)
.