Correct use of promotion and conversion

You’re just missing a constructor that makes a RationalNumber from another of a different type:

RationalNumber{T}(r::RationalNumber) where {T} = RationalNumber{T}(r.num, r.den)
4 Likes