291
291
Base. @propagate_inbounds Base. getindex (A:: WrapArray , i:: Integer... ) = A. data[i... ]
292
292
Base. @propagate_inbounds Base. setindex! (A:: WrapArray , v:: Any , i:: Integer... ) = setindex! (A. data, v, i... )
293
293
Base. size (A:: WrapArray ) = size (A. data)
294
+ Base. axes (A:: WrapArray ) = axes (A. data)
294
295
Broadcast. BroadcastStyle (:: Type{WrapArray{T,N,P}} ) where {T,N,P} = Broadcast. BroadcastStyle (P)
295
296
StaticArrays. isstatic (A:: WrapArray ) = StaticArrays. isstatic (A. data)
296
297
StaticArrays. Size (:: Type{WrapArray{T,N,P}} ) where {T,N,P} = StaticArrays. Size (P)
@@ -302,10 +303,14 @@ end
302
303
data = (1 , 2 )
303
304
for T in (SVector{2 }, MVector{2 })
304
305
a = T (data)
305
- b = WrapArray (a)
306
- @test @inferred (b .+ a) isa T
307
- @test @inferred (b .+ b) isa T
308
- @test @inferred (b .+ (1 , 2 )) isa T
309
- @test b .+ a == b .+ b == a .+ a
306
+ for b in (WrapArray (a), WrapArray (a' ))
307
+ @test @inferred (b .+ a) isa T
308
+ @test @inferred (b .+ b) isa T
309
+ @test @inferred (b .+ (1 , 2 )) isa T
310
+ @test @inferred (b .+ a' ) isa StaticMatrix
311
+ @test @inferred (a' .+ b) isa StaticMatrix
312
+ # @test @inferred(b' .+ a') isa StaticMatrix # Adjoint doesn't propagate style
313
+ @test b .+ b. data == b .+ b == b. data .+ b. data
314
+ end
310
315
end
311
316
end
0 commit comments