@@ -134,6 +134,10 @@ using StaticArrays, Test, LinearAlgebra
134
134
msr = reshape (ms, SOneTo (4 ))
135
135
msr[2 ] = 10
136
136
@test ms == SA[1 2 ; 10 4 ]
137
+
138
+ s = SA[1 ,2 ];
139
+ s2 = @inferred reshape (s, axes (s,1 ), axes (s,2 ))
140
+ @test s2 isa StaticArray
137
141
end
138
142
139
143
@testset " copy" begin
@@ -200,7 +204,7 @@ using StaticArrays, Test, LinearAlgebra
200
204
@test @inferred (convert (AbstractArray{Float64}, diag)) isa Diagonal{Float64,SVector{2 ,Float64}}
201
205
@test convert (AbstractArray{Float64}, diag) == diag
202
206
# The following cases currently convert the SMatrix into an MMatrix, because
203
- # the constructor in Base invokes `similar`, rather than `convert`, on the static
207
+ # the constructor in Base invokes `similar`, rather than `convert`, on the static
204
208
# array. This was fixed in https://github.com/JuliaLang/julia/pull/40831; so should
205
209
# work from Julia v1.8.0-DEV.55
206
210
trans = Transpose (SVector (1 ,2 ))
297
301
@test Base. rest (x) == x
298
302
a, b... = x
299
303
@test b == SA[2 , 3 ]
300
-
304
+
301
305
x = SA[1 2 ; 3 4 ]
302
306
@test Base. rest (x) == vec (x)
303
307
a, b... = x
@@ -306,14 +310,14 @@ end
306
310
a, b... = SA[1 ]
307
311
@test b == []
308
312
@test b isa SVector{0 }
309
-
313
+
310
314
for (Vec, Mat) in [(MVector, MMatrix), (SizedVector, SizedMatrix)]
311
315
x = Vec (1 , 2 , 3 )
312
316
@test Base. rest (x) == x
313
317
@test pointer (Base. rest (x)) != pointer (x)
314
318
a, b... = x
315
319
@test b == Vec (2 , 3 )
316
-
320
+
317
321
x = Mat {2,2} (1 , 2 , 3 , 4 )
318
322
@test Base. rest (x) == vec (x)
319
323
@test pointer (Base. rest (x)) != pointer (x)
0 commit comments