-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Labels
broadcastApplying a function over a collectionApplying a function over a collectionwon't changeIndicates that work won't continue on an issue or pull requestIndicates that work won't continue on an issue or pull request
Description
It appears that some simple uses of the element-wise call syntax .( are not lowered to a standard broadcast call. This is a problem for NullableArray where we would like to overload broadcast to apply lifting semantics (JuliaStats/NullableArrays.jl#166).
For example, the following code doesn't call broadcast(get, X, 0). Therefore it fails since my custom broadcast function has a special behavior for get which doesn't get triggered here.
Why it this the case?
julia> expand(:(get.([Nullable()], 0)))
:($(Expr(:thunk, CodeInfo(:(begin
$(Expr(:thunk, CodeInfo(:(begin
global ##3#4
const ##3#4
$(Expr(:composite_type, Symbol("##3#4"), :((Core.svec)()), :((Core.svec)()), :(Core.Function), :((Core.svec)()), false, 0))
return
end))))
$(Expr(:method, false, :((Core.svec)((Core.svec)(##3#4,Any),(Core.svec)())), CodeInfo(:(begin
return get(#temp#,0)
end)), false))
#3 = $(Expr(:new, Symbol("##3#4")))
SSAValue(0) = #3
SSAValue(1) = (Base.vect)(Nullable())
return (Base.broadcast)(SSAValue(0),SSAValue(1))
end)))))Metadata
Metadata
Assignees
Labels
broadcastApplying a function over a collectionApplying a function over a collectionwon't changeIndicates that work won't continue on an issue or pull requestIndicates that work won't continue on an issue or pull request