fix #7564

this is a combination of convert(Rational{T},x) not returning the
correct type, and the lack of a type check in codegen for new().