File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -184,6 +184,13 @@ else
184184 end
185185end
186186
187+ macro allowscalar (p)
188+ quote
189+ $ (allowscalar)($ (esc (p)))
190+ @Core . latestworld
191+ end
192+ end
193+
187194@inline _is_fixed (:: AbstractArray ) = false
188195@inline _is_fixed (A:: AbstractArray , Bs:: Vararg{Any,N} ) where N = _is_fixed (A) || (N > 0 && _is_fixed (Bs... ))
189196macro if_move_fixed (a... )
Original file line number Diff line number Diff line change @@ -4,20 +4,20 @@ using Test, SparseArrays
44 A = sprandn (10 , 20 , 0.9 )
55 A[1 , 1 ] = 2
66 @test A[1 , 1 ] == 2
7- SparseArrays. allowscalar (false )
7+ SparseArrays. @ allowscalar (false )
88 @test_throws Any A[1 , 1 ]
99 @test_throws Any A[1 , 1 ] = 2
10- SparseArrays. allowscalar (true )
10+ SparseArrays. @ allowscalar (true )
1111 @test A[1 , 1 ] == 2
1212 A[1 , 1 ] = 3
1313 @test A[1 , 1 ] == 3
1414
1515 B = sprandn (10 , 0.9 )
1616 B[1 ] = 2
1717 @test B[1 ] == 2
18- SparseArrays. allowscalar (false )
18+ SparseArrays. @ allowscalar (false )
1919 @test_throws Any B[1 ]
20- SparseArrays. allowscalar (true )
20+ SparseArrays. @ allowscalar (true )
2121 @test B[1 ] == 2
2222 B[1 ] = 3
2323 @test B[1 ] == 3
You can’t perform that action at this time.
0 commit comments