Permalink
Browse files

further promotion rule simplifications

  • Loading branch information...
1 parent 57767ac commit f0e86116e4016d7d7367a38057078adf7e12069e @StefanKarpinski StefanKarpinski committed Jan 21, 2014
Showing with 1 addition and 9 deletions.
  1. +0 −1 base/complex.jl
  2. +0 −1 base/rational.jl
  3. +1 −7 base/string.jl
View
@@ -27,7 +27,6 @@ convert{T<:Real}(::Type{Complex{T}}, z::Complex) =
convert{T<:Real}(::Type{T}, z::Complex) = (imag(z)==0 ? convert(T,real(z)) :
throw(InexactError()))
-promote_rule{T<:Real}(::Type{Complex{T}}, ::Type{T}) = Complex{T}
promote_rule{T<:Real,S<:Real}(::Type{Complex{T}}, ::Type{S}) =
Complex{promote_type(T,S)}
promote_rule{T<:Real,S<:Real}(::Type{Complex{T}}, ::Type{Complex{S}}) =
View
@@ -53,7 +53,6 @@ end
convert(::Type{Rational}, x::Float64) = convert(Rational{Int64}, x)
convert(::Type{Rational}, x::Float32) = convert(Rational{Int}, x)
-promote_rule{T<:Integer}(::Type{Rational{T}}, ::Type{T}) = Rational{T}
promote_rule{T<:Integer,S<:Integer}(::Type{Rational{T}}, ::Type{S}) = Rational{promote_type(T,S)}
promote_rule{T<:Integer,S<:Integer}(::Type{Rational{T}}, ::Type{Rational{S}}) = Rational{promote_type(T,S)}
promote_rule{T<:Integer,S<:FloatingPoint}(::Type{Rational{T}}, ::Type{S}) = promote_type(T,S)
View
@@ -814,13 +814,7 @@ end
## string promotion rules ##
-promote_rule(::Type{UTF8String} , ::Type{ASCIIString}) = UTF8String
-promote_rule(::Type{UTF8String} , ::Type{UTF16String}) = UTF8String
-promote_rule(::Type{ASCIIString}, ::Type{UTF16String}) = UTF8String
-promote_rule(::Type{UTF32String}, ::Type{UTF16String}) = UTF8String
-promote_rule(::Type{UTF8String} , ::Type{UTF32String}) = UTF8String
-promote_rule(::Type{ASCIIString}, ::Type{UTF32String}) = UTF8String
-promote_rule{T<:String}(::Type{RepString}, ::Type{T}) = RepString
+promote_rule{S<:String,T<:String}(::Type{S}, ::Type{T}) = UTF8String
## printing literal quoted string data ##

0 comments on commit f0e8611

Please sign in to comment.