That is a solution but not for what I had in mind, I’m sorry I did not specify more clearly before. What I would like from the outer constructor is to declare the type of the field val implicitly, like so
julia> struct Foo{T <: Integer, N}
val::T
end
julia> function Foo{N}(val::T) where {N, T}
return Foo{T, N}(val)
end
Here the same error is thrown, but if I change the order of the parameters in the declaration of Foo, then, there is no problem.
I tried to so the same thing done in this document I found online here. At In [20], he defines the parametric type for a finite field with characteristic N, but the order of the parameters seemed weird, compared to other Julia code I have seen. Does the order matter in this case, and if it does, why?