Skip to content

Commit 5a53ef2

Browse files
committed
Recursively process fill components
1 parent c141ff8 commit 5a53ef2

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/fillbroadcast.jl

+1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ _isfill(f::Ref) = true
119119
_isfill(::Any) = false
120120

121121
_broadcast_maybecopy(bc::Broadcast.Broadcasted{<:AbstractFillStyle}) = copy(bc)
122+
_broadcast_maybecopy(bc::Broadcast.Broadcasted) = Broadcast.broadcasted(bc.f, map(_broadcast_maybecopy, bc.args)...)
122123
_broadcast_maybecopy(x) = x
123124

124125
function _fallback_copy(bc)

test/runtests.jl

+2
Original file line numberDiff line numberDiff line change
@@ -1214,6 +1214,8 @@ end
12141214
@testset "early binding" begin
12151215
A = ones(2) .+ (x -> rand()).(Fill(2,2))
12161216
@test all(==(A[1]), A)
1217+
A = ones(1,5) .+ (ones(1) .+ (_ -> rand()).(Fill("vec", 2)))
1218+
@test all(==(A[1]), A)
12171219
end
12181220
end
12191221

0 commit comments

Comments
 (0)