Skip to content

Commit 20dba29

Browse files
authored
Merge pull request #82 from tkoolen/tk-fix-fill
Fix fill
2 parents 8ecb78a + ef5c386 commit 20dba29

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/arraymath.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ end
104104
return quote
105105
$(Expr(:meta, :inline))
106106
valT = convert($T, val)
107-
SA($(expr...))
107+
$(Expr(:call, SA, Expr(:tuple, expr...)))
108108
end
109109
end
110110

test/arraymath.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,9 @@
6161
@test zero(SVector{3, Float64}) === @SVector [0.0, 0.0, 0.0]
6262
@test zero(SVector{3, Int}) === @SVector [0, 0, 0]
6363
end
64+
65+
@testset "fill()" begin
66+
@test all(fill(3., SMatrix{4, 16, Float64}) .== 3.)
67+
@test @allocated(fill(0., SMatrix{1, 16, Float64})) == 0 # #81
68+
end
6469
end

0 commit comments

Comments
 (0)