Skip to content

Commit

Permalink
remove special * methods for Bool, which tend to cause ambiguities
Browse files Browse the repository at this point in the history
part of #19168
  • Loading branch information
JeffBezanson committed Aug 24, 2017
1 parent 0f4baee commit 37f21a9
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions base/bool.jl
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,6 @@ function +(x::Bool, y::T)::promote_type(Bool,T) where T<:AbstractFloat
end
+(y::AbstractFloat, x::Bool) = x + y

function *(x::Bool, y::T)::promote_type(Bool,T) where T<:Number
return ifelse(x, y, copysign(zero(y), y))
end
function *(x::Bool, y::T)::promote_type(Bool,T) where T<:Unsigned
return ifelse(x, y, zero(y))
end
*(y::Number, x::Bool) = x * y

div(x::Bool, y::Bool) = y ? x : throw(DivideError())
fld(x::Bool, y::Bool) = div(x,y)
cld(x::Bool, y::Bool) = div(x,y)
Expand Down

0 comments on commit 37f21a9

Please sign in to comment.