Skip to content

Commit

Permalink
edited comments, added reminders to fix VectorStyle, MatrixStyle
Browse files Browse the repository at this point in the history
  • Loading branch information
pablosanjose committed Dec 10, 2017
1 parent b70fae3 commit d7b23dd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/broadcast.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ else

BroadcastStyle(::Type{<:StaticArray{D, T, N}}) where {D, T, N} = StaticArrayStyle{N}()

# Precedence rules: needed in particular to make StaticArray - Array -> Array
BroadcastStyle(::StaticArrayStyle{M}, ::Broadcast.VectorStyle) where M = Broadcast.Unknown()
BroadcastStyle(::StaticArrayStyle{M}, ::Broadcast.MatrixStyle) where M = Broadcast.Unknown()
# Precedence rules
BroadcastStyle(::StaticArrayStyle{M}, ::Broadcast.DefaultArrayStyle{N}) where {M,N} =
Broadcast.DefaultArrayStyle(Broadcast._max(Val(M), Val(N)))
# FIXME: These two rules should be removed once VectorStyle and MatrixStyle are removed from base/broadcast.jl
BroadcastStyle(::StaticArrayStyle{M}, ::Broadcast.VectorStyle) where M = Broadcast.Unknown()
BroadcastStyle(::StaticArrayStyle{M}, ::Broadcast.MatrixStyle) where M = Broadcast.Unknown()
# End FIXME

# Add a broadcast method that calls the @generated routine
@inline function broadcast(f, ::StaticArrayStyle, ::Void, ::Void, As...)
Expand Down

0 comments on commit d7b23dd

Please sign in to comment.