File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -339,6 +339,8 @@ reduce_empty(::typeof(+), ::Type{T}) where {T} = zero(T)
339339reduce_empty (:: typeof (+ ), :: Type{Bool} ) = zero (Int)
340340reduce_empty (:: typeof (* ), :: Type{T} ) where {T} = one (T)
341341reduce_empty (:: typeof (* ), :: Type{<:AbstractChar} ) = " "
342+ reduce_empty (:: typeof (& ), :: Type{Bool} ) = true
343+ reduce_empty (:: typeof (| ), :: Type{Bool} ) = false
342344reduce_empty (:: typeof (and_all), :: Type{T} ) where {T} = true
343345reduce_empty (:: typeof (or_any), :: Type{T} ) where {T} = false
344346
Original file line number Diff line number Diff line change 686686 @test any ([true , true , true ], dims = 1 ) == [true ]
687687 @test_throws TypeError all ([3 , 3 , 3 ], dims = 1 )
688688 @test_throws TypeError any ([3 , 3 , 3 ], dims = 1 )
689+ @test reduce (| , Bool[]) == false
690+ @test reduce (& , Bool[]) == true
691+ @test reduce (| , Bool[], dims= 1 ) == [false ]
692+ @test reduce (& , Bool[], dims= 1 ) == [true ]
689693end
690694
691695# issue #45748
You can’t perform that action at this time.
0 commit comments