Here I was expecting an Int type, but got a Float:
julia> function test()
i::Int = 3.0
end
test (generic function with 1 method)
julia> typeof(test())
Float64
and in this case, the return type is Int:
julia> function test()
i::Int = 3.0
i
end
test (generic function with 1 method)
julia> typeof(test())
Int64
Is this the correct behavior or error?
source
share