pxshen might’ve expected ^(::Int, ::Int) to return a Float64 because negative powers like 5^-4 do work that way in the REPL. I’m not actually sure how because reflection gives the integer powers method that throws an error on negative exponents, and powers of non-literal integers does accordingly throw on negative exponents.
OT, but this is because the parsing or lowering stage of the compiler transforms ^, where the exponent is a literal, to Base.literal_pow calls. IMO that was a bad idea, for the reason you give.