Skip to content

Commit a44245e

Browse files
committed
Skip type inference check in older Julia versions
1 parent 81185a4 commit a44245e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/svd.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ using MatrixAlgebraKit: TruncationKeepAbove, diagview
2222
minmn = min(m, n)
2323
A = randn(rng, T, m, n)
2424

25-
U, S, Vᴴ = @constinferred svd_compact(A; alg=($alg))
25+
if VERSION < v"1.12"
26+
# This is type unstable on older versions of Julia.
27+
U, S, Vᴴ = svd_compact(A; alg)
28+
else
29+
U, S, Vᴴ = @constinferred svd_compact(A; alg=($alg))
30+
end
2631
@test U isa Matrix{T} && size(U) == (m, minmn)
2732
@test S isa Diagonal{real(T)} && size(S) == (minmn, minmn)
2833
@test Vᴴ isa Matrix{T} && size(Vᴴ) == (minmn, n)

0 commit comments

Comments
 (0)