Skip to content

Commit 59619ca

Browse files
committed
restrict type-stability tests to v1.2+
1 parent 18064ca commit 59619ca

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

test/linalg.jl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,14 @@ StaticArrays.similar_type(::Union{RotMat2,Type{RotMat2}}) = SMatrix{2,2,Float64,
230230
@test norm(a, 0) norm(a′, 0)
231231

232232
# type-stability
233-
@test (@inferred norm(a[1])) == (@inferred norm(a[1], 2))
234-
@test (@inferred norm(a)) == (@inferred norm(a, 2))
235-
@test (@inferred norm(aa)) == (@inferred norm(aa, 2))
236-
@test (@inferred norm(float.(aa))) == (@inferred norm(float.(aa), 2))
233+
if VERSION v"1.2"
234+
# only test strict type-stability on v1.2+, since there were Base-related type
235+
# instabilities in `norm` prior to https://github.com/JuliaLang/julia/pull/30481
236+
@test (@inferred norm(a[1])) == (@inferred norm(a[1], 2))
237+
@test (@inferred norm(a)) == (@inferred norm(a, 2))
238+
@test (@inferred norm(aa)) == (@inferred norm(aa, 2))
239+
@test (@inferred norm(float.(aa))) == (@inferred norm(float.(aa), 2))
240+
end
237241

238242
# norm of empty SVector
239243
@test norm(SVector{0,Int}()) isa float(Int)

0 commit comments

Comments
 (0)