Suppose I have a constructor with some type parameters that do not correspond to fields, which I would like to determine automatically, in addition to getting the rest from keywords. Eg
Base.@kwdef struct Foo{K,T}
x::T
end
Foo{3}(; x = 9.0) # want this to work
I am aware that I could just define
Foo{K}(; x::T) where {K,T} = Foo{K,T}(; x)
but manually enumerating arguments becomes tedious when there are many fields and defeats the convenience of the keyword constructor.
A convenient solution, which would not require enumerating all fields again, would be nice.