I would like to define a parametric type that constrains a NamedTuple
to have values of a certain type, but I am running into a problem. I am not sure if it is a bug, and if there is a workaround (other than specifying the length as a type parameter).
MWE:
julia> struct ExampleType{N, T, S <: NamedTuple{N,Tuple{Vararg{T}}}}
x::T
y::S
end
julia> ExampleType{(:a,:b),Float64}
ERROR: NamedTuple names and field types must have matching lengths
Stacktrace:
[1] top-level scope at REPL[69]:1
julia> VERSION
v"1.4.0-rc1.0"