From fbb90970978e99b4b65f4672d350135c08e0f0e7 Mon Sep 17 00:00:00 2001 From: maartenvd Date: Fri, 2 Sep 2022 12:59:16 +0200 Subject: [PATCH] what does CI say? --- src/unzipped.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/unzipped.jl b/src/unzipped.jl index fe5875e6f..8f4e9b08c 100644 --- a/src/unzipped.jl +++ b/src/unzipped.jl @@ -35,7 +35,7 @@ function unzip_broadcast(f::F, args...) where {F} # This is a crude way to allow GPU arrays, not currently tested, TODO. # See also https://github.com/JuliaArrays/StructArrays.jl/issues/150 return unzip(broadcast(f, args...)) - elseif bcs isa Broadcast.AbstractArrayStyle + elseif bcs isa Broadcast.Broadcast.ArrayStyle{<:Array} # components of a structarray is array, so it has to broadcast to an array return StructArrays.components(StructArray(bc)) else return unzip(broadcast(f, args...)) # e.g. tuples @@ -103,7 +103,7 @@ function unzip(xs::AbstractArray) end @generated function unzip(xs, ::Val{N}) where {N} - each = [:(map($(Get(i)), xs)) for i in 1:N] + each = [:(broadcast($(Get(i)), xs)) for i in 1:N] Expr(:tuple, each...) end @@ -114,7 +114,7 @@ unzip(xs::AbstractArray{Tuple{T}}) where {T} = (reinterpret(T, xs),) # best cas # good case, no copy of data, some trivial arrays [Base.issingletontype(T) ? :(similar(xs, $T)) : :(reinterpret($T, xs)) for T in Ts.parameters] else - [:(map($(Get(i)), xs)) for i in 1:length(fieldnames(Ts))] + [:(broadcast($(Get(i)), xs)) for i in 1:length(fieldnames(Ts))] end Expr(:tuple, each...) end