diff --git a/examples/quaternion.jl b/examples/quaternion.jl index 92d85f05c0c08..b6acee005bf0a 100644 --- a/examples/quaternion.jl +++ b/examples/quaternion.jl @@ -17,7 +17,8 @@ convert{T}(::Type{Quaternion{T}}, z::Quaternion) = promote_rule{T,S}(::Type{Complex{T}}, ::Type{Quaternion{S}}) = Quaternion{promote_type(T,S)} -promote_rule{T,S}(::Type{Real{T}}, ::Type{Quaternion{S}}) = +promote_rule{S}(::Type{Bool}, ::Type{Quaternion{S}}) = Quaternion{S} +promote_rule{T<:Real,S}(::Type{T}, ::Type{Quaternion{S}}) = Quaternion{promote_type(T,S)} function show(z::Quaternion)