I want to prepare a example but aren’t able to create it. Can someone help me
julia> struct ModInt{N <: Integer} <: Integer
k::Integer
ModInt{N}(k::Integer) where {N <: Integer} = new(mod(k,N))
end
julia> ModInt{2}(1)
ERROR: TypeError: in ModInt, in N, expected N<:Integer, got a value of type Int64
Stacktrace:
[1] top-level scope at REPL[2]:1
Thank you!
6 posts - 2 participants