Skip to content

Commit

Permalink
Add condition::Bool constraint to Base.ifelse
Browse files Browse the repository at this point in the history
Co-authored-by: Jeff Bezanson <[email protected]>
  • Loading branch information
c42f and JeffBezanson authored Sep 3, 2020
1 parent 24a5921 commit 73e8316
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/essentials.jl
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ julia> ifelse(1 > 2, 1, 2)
2
```
"""
ifelse(condition, x, y) = Core.ifelse(condition, x, y)
ifelse(condition::Bool, x, y) = Core.ifelse(condition, x, y)

# simple Array{Any} operations needed for bootstrap
@eval setindex!(A::Array{Any}, @nospecialize(x), i::Int) = arrayset($(Expr(:boundscheck)), A, x, i)
Expand Down

0 comments on commit 73e8316

Please sign in to comment.