Skip to content

Commit a238b61

Browse files
committed
Fix tests in Julia 1.10
1 parent 0c8dc98 commit a238b61

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

test/test_basics.jl

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,21 @@ include("TestBlockSparseArraysUtils.jl")
5050
Matrix{Float32}
5151
@test @constinferred(similartype_unchecked(Array{Float32}, NTuple{2,Base.OneTo{Int}})) ===
5252
Matrix{Float32}
53-
@test @constinferred(similartype_unchecked(AbstractArray{Float32}, NTuple{2,Int})) ===
54-
Matrix{Float32}
55-
@test @constinferred(similartype_unchecked(JLArray{Float32}, NTuple{2,Int})) ===
56-
JLMatrix{Float32}
57-
@test @constinferred(
58-
similartype_unchecked(JLArray{Float32}, NTuple{2,Base.OneTo{Int}})
59-
) === JLMatrix{Float32}
53+
if VERSION < v"1.11-"
54+
# Not type stable in Julia 1.10.
55+
@test similartype_unchecked(AbstractArray{Float32}, NTuple{2,Int}) === Matrix{Float32}
56+
@test similartype_unchecked(JLArray{Float32}, NTuple{2,Int}) === JLMatrix{Float32}
57+
@test similartype_unchecked(JLArray{Float32}, NTuple{2,Base.OneTo{Int}}) ===
58+
JLMatrix{Float32}
59+
else
60+
@test @constinferred(similartype_unchecked(AbstractArray{Float32}, NTuple{2,Int})) ===
61+
Matrix{Float32}
62+
@test @constinferred(similartype_unchecked(JLArray{Float32}, NTuple{2,Int})) ===
63+
JLMatrix{Float32}
64+
@test @constinferred(
65+
similartype_unchecked(JLArray{Float32}, NTuple{2,Base.OneTo{Int}})
66+
) === JLMatrix{Float32}
67+
end
6068
end
6169

6270
arrayts = (Array, JLArray)

0 commit comments

Comments
 (0)