I am new to Julia and the REPL answers seems strange to me:
When I run this uncorrect code :
mat = [1 2 3; 4 5 6]
function minus(mat::Array{Int64,2}, min)::Array{UInt8,2}
out = mat-min;
# out = UInt8.(out);
return out;
end
minmat = minus(mat);
I get this correct error message :
ERROR: LoadError: MethodError: no method matching minus(::Array{Int64,2})
Closest candidates are:
minus(::Array{Int64,2}, ::Any) at /home/hugo/dev/julia/test.jl:5
But when I run this correct (I guess) code :
mat = [1 2 3; 4 5 6]
function minus(mat::Array{Int64,2}, min)::Array{UInt8,2}
out = mat-min;
# out = UInt8.(out);
return out;
end
minmat = minus(mat, 1);
Julia gives me this incorrect error message :
ERROR: LoadError: MethodError: no method matching -(::Array{Int64,2}, ::Int64)
Closest candidates are:
-(::Complex{Bool}, ::Real) at complex.jl:298
-(::Missing, ::Number) at missing.jl:93
-(::Base.CoreLogging.LogLevel, ::Integer) at logging.jl:107
...
(notice the '-' in the function signature)
I see nothing related to this in the doc, so I am a bit confused, that's why I'm asking here.