I tried this and it stubbornly refuses to accept anything but Int64:
check = Int8(4)
ERROR: MethodError: no method matching testint(::Int8)
Closest candidates are:
Obviously “arg::Int” is implicitly becoming “arg::Int64”.
Ok this works:
Int === Int64 on 64 bit builds of Julia, while on 32-bit builds
Int === Int32. That is,
Int is concrete, aliasing the signed integer matching the Julia build type.
UInt is the same way, but for unsigned integers.
Looks like you found the answer yourself. Just in case this is useful next time, if you are trying to find an appropriate supertype, use
supertypes. For example:
(Int64, Signed, Integer, Real, Number, Any)
This allows you to choose the most appropriate supertype for your function signature. Hope that helps!