Skip to content

Commit c7fa1e2

Browse files
HACK: or heresy?
1 parent 280ecf0 commit c7fa1e2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/methods.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,18 @@ for f in vcat(diadic, [+, -, *, \, /, ^])
9797
@eval promote_symtype(::$(typeof(f)),
9898
T::Type{<:Number},
9999
S::Type{<:Number}) = promote_type(T, S)
100+
@eval promote_symtype(::$(typeof(f)),
101+
T::Type{<:Rational},
102+
S::Type{Integer}) = Rational
103+
@eval promote_symtype(::$(typeof(f)),
104+
T::Type{Integer},
105+
S::Type{<:Rational}) = Rational
106+
@eval promote_symtype(::$(typeof(f)),
107+
T::Type{<:Complex{<:Rational}},
108+
S::Type{Integer}) = Complex{Rational}
109+
@eval promote_symtype(::$(typeof(f)),
110+
T::Type{Integer},
111+
S::Type{<:Complex{<:Rational}}) = Complex{Rational}
100112
for R in [SafeRealImpl, LiteralRealImpl]
101113
@eval function promote_symtype(::$(typeof(f)),
102114
T::Type{<:$R},

0 commit comments

Comments
 (0)