Skip to content

Fix map for Julia v0.7 #296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 11, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/mapreduce.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@

# The following type signature for map() matches any list of AbstractArrays,
# provided at least one is a static array.
@inline function map(f, as::Union{SA,AbstractArray}...) where {SA<:StaticArray}
_map(f, same_size(as...), as...)
if VERSION < v"0.7.0-"
@inline function map(f, as::Union{SA,AbstractArray}...) where {SA<:StaticArray}
_map(f, same_size(as...), as...)
end
else
@inline function map(f, a1::StaticArray, as::AbstractArray...)
_map(f, same_size(a1, as...), a1, as...)
end
end

@generated function _map(f, ::Size{S}, a::AbstractArray...) where {S}
Expand Down