a,b,c = 1:3
@with_kw mutable struct T
a
b
end
T(;a,b)
works
T(;a,b,c)
fails
Can the kwargs constructor have a Varargs component X...
?
It allowed me to create one T(;a,b, X... ) = T(;a,b)
But T(;a,b,c)
then gives a stack overflow error.
Lincoln_Hannah:
Can the kwargs constructor have a Varargs component X...
?
It allowed me to create one T(;a,b, X... ) = T(;a,b)
But T(;a,b,c)
then gives a stack overflow error.
I do believe you redefined the one and unique method that has only keyword parameters with your version, so now it just calls itself recursively forever.
Cannot you do T(;a,b, X... ) = T(a,b)
instead?
1 Like
That works thank you.
Can the kwargs constructor generated by @with_kw be set to automatically add the Varargs component?