File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name = " FillArrays"
22uuid = " 1a297f60-69ca-5386-bcde-b61e274b549b"
3- version = " 0.12.6 "
3+ version = " 0.12.7 "
44
55[deps ]
66LinearAlgebra = " 37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Original file line number Diff line number Diff line change 204204function + (a:: Fill{T, 1} , b:: AbstractRange ) where {T}
205205 size (a) ≠ size (b) && throw (DimensionMismatch (" dimensions must match." ))
206206 Tout = promote_type (T, eltype (b))
207- return (a. value + first (b)): convert (Tout, step (b)): (a. value + last (b))
208- end
209- function + (a:: Fill{T, 1} , b:: UnitRange ) where {T}
210- size (a) ≠ size (b) && throw (DimensionMismatch (" dimensions must match." ))
211- Tout = promote_type (T, eltype (b))
212- return (a. value + first (b)): (a. value + last (b))
207+ return a. value .+ b
213208end
214209+ (a:: AbstractRange , b:: AbstractFill ) = b + a
215210
Original file line number Diff line number Diff line change 694694 @test_throws DimensionMismatch rnge .+ Zeros (5 )
695695 @test_throws DimensionMismatch rnge .- Zeros (5 )
696696 @test_throws DimensionMismatch Zeros (5 ) .+ rnge
697+
698+ @test Fill (2 ,10 ) + (1 : 10 ) isa UnitRange
699+ @test (1 : 10 ) + Fill (2 ,10 ) isa UnitRange
700+
701+ f = Fill (1 + im,10 )
702+ @test f + rnge isa AbstractRange
703+ @test f + rnge == rnge + f
704+ @test f + (1 : 10 ) isa AbstractRange
697705 end
698706
699707 @testset " Special Zeros/Ones" begin
You can’t perform that action at this time.
0 commit comments