@@ -338,28 +338,33 @@ end
338338# Val
339339begin
340340 local firstlast
341- firstlast (:: Type{ Val{true} } ) = " First"
342- firstlast (:: Type{ Val{false} } ) = " Last"
341+ firstlast (:: Val{true} ) = " First"
342+ firstlast (:: Val{false} ) = " Last"
343343
344- @test firstlast (Val{ true } ) == " First"
345- @test firstlast (Val{ false } ) == " Last"
344+ @test firstlast (Val ( true ) ) == " First"
345+ @test firstlast (Val ( false ) ) == " Last"
346346end
347347
348+ # The constructors for some linear algebra stuff changed to take Val{x}
349+ # instead of Type{Val{x}}
350+ const valtrue = VERSION < v " 0.7.0-DEV.843" ? Val{true } : Val (true )
351+ const valfalse = VERSION < v " 0.7.0-DEV.843" ? Val{false } : Val (false )
352+
348353# qr, qrfact, qrfact!
349354let A = [1.0 2.0 ; 3.0 4.0 ]
350- Q, R = qr (A, Val{ false } )
355+ Q, R = qr (A, valfalse )
351356 @test Q* R ≈ A
352- Q, R, p = qr (A, Val{ true } )
357+ Q, R, p = qr (A, valtrue )
353358 @test Q* R ≈ A[:,p]
354- F = qrfact (A, Val{ false } )
359+ F = qrfact (A, valfalse )
355360 @test F[:Q ]* F[:R ] ≈ A
356- F = qrfact (A, Val{ true } )
361+ F = qrfact (A, valtrue )
357362 @test F[:Q ]* F[:R ] ≈ A[:,F[:p ]]
358363 A_copy = copy (A)
359- F = qrfact! (A_copy, Val{ false } )
364+ F = qrfact! (A_copy, valfalse )
360365 @test F[:Q ]* F[:R ] ≈ A
361366 A_copy = copy (A)
362- F = qrfact! (A_copy, Val{ true } )
367+ F = qrfact! (A_copy, valtrue )
363368 @test F[:Q ]* F[:R ] ≈ A[:,F[:p ]]
364369end
365370
@@ -1397,11 +1402,11 @@ for A in (Hermitian(randn(5,5) + 10I),
13971402 @test istriu (chol (A))
13981403 @test chol (A) ≈ F[:U ]
13991404
1400- F = cholfact (A, Val{ true } )
1405+ F = cholfact (A, valtrue )
14011406 @test F[:U ]' F[:U ] ≈ A[F[:p ], F[:p ]]
14021407 @test F[:L ]* F[:L ]' ≈ A[F[:p ], F[:p ]]
14031408 Ac = copy (A)
1404- F = cholfact! (Ac, Val{ true } )
1409+ F = cholfact! (Ac, valfalse )
14051410 @test F[:U ]' F[:U ] ≈ A[F[:p ], F[:p ]]
14061411 @test F[:L ]* F[:L ]' ≈ A[F[:p ], F[:p ]]
14071412end
0 commit comments