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)
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)