@@ -13,12 +13,12 @@ using Aqua: Aqua
1313 @test CallableWithReturnType{Float32} == ComposedFunction{Base. Fix2{typeof (typeassert), Type{Float32}}}
1414 end
1515 @testset " construction" begin
16- @test (@inferred typed_callable (Float64, cos )) isa CallableWithReturnType
17- @test (@inferred typed_callable (Float64, cos )) isa CallableWithReturnType{Float64}
18- @test (@inferred typed_callable (Float64, cos )) isa CallableWithReturnType{Float64, typeof (cos)}
16+ @test (@inferred typed_callable (cos, Float64 )) isa CallableWithReturnType
17+ @test (@inferred typed_callable (cos, Float64 )) isa CallableWithReturnType{Float64}
18+ @test (@inferred typed_callable (cos, Float64 )) isa CallableWithReturnType{Float64, typeof (cos)}
1919 end
2020 @testset " return type enforcement" begin
21- f = typed_callable (Int, only ):: CallableWithReturnType
21+ f = typed_callable (only, Int ):: CallableWithReturnType
2222 x_int = Any[3 ]
2323 x_f64 = Any[3.0 ]
2424 @test 3 === @inferred f (x_int)
@@ -33,24 +33,24 @@ using Aqua: Aqua
3333 @test_throws TypeError CallableWithTypeSignature{<: Any , Int}
3434 end
3535 @testset " construction" begin
36- @test (@inferred typed_callable (Float64, Tuple{Int, Int}, hypot )) isa CallableWithTypeSignature
37- @test (@inferred typed_callable (Float64, Tuple{Int, Int}, hypot )) isa CallableWithTypeSignature{Float64}
38- @test (@inferred typed_callable (Float64, Tuple{Int, Int}, hypot )) isa CallableWithTypeSignature{Float64, Tuple{Int, Int}}
39- @test (@inferred typed_callable (Float64, Tuple{Int, Int}, hypot )) isa CallableWithTypeSignature{Float64, Tuple{Int, Int}, typeof (hypot)}
40- @test (@inferred typed_callable (Int, Tuple{Float32}, Int )) isa CallableWithTypeSignature
41- @test (@inferred typed_callable (Int, Tuple{Float32}, Int )) isa CallableWithTypeSignature{Int}
42- @test (@inferred typed_callable (Int, Tuple{Float32}, Int )) isa CallableWithTypeSignature{Int, Tuple{Float32}}
43- @test (@inferred typed_callable (Int, Tuple{Float32}, Int )) isa CallableWithTypeSignature{Int, Tuple{Float32}, Type{Int}}
36+ @test (@inferred typed_callable (hypot, Float64, Tuple{Int, Int})) isa CallableWithTypeSignature
37+ @test (@inferred typed_callable (hypot, Float64, Tuple{Int, Int})) isa CallableWithTypeSignature{Float64}
38+ @test (@inferred typed_callable (hypot, Float64, Tuple{Int, Int})) isa CallableWithTypeSignature{Float64, Tuple{Int, Int}}
39+ @test (@inferred typed_callable (hypot, Float64, Tuple{Int, Int})) isa CallableWithTypeSignature{Float64, Tuple{Int, Int}, typeof (hypot)}
40+ @test (@inferred typed_callable (Int, Int, Tuple{Float32})) isa CallableWithTypeSignature
41+ @test (@inferred typed_callable (Int, Int, Tuple{Float32})) isa CallableWithTypeSignature{Int}
42+ @test (@inferred typed_callable (Int, Int, Tuple{Float32})) isa CallableWithTypeSignature{Int, Tuple{Float32}}
43+ @test (@inferred typed_callable (Int, Int, Tuple{Float32})) isa CallableWithTypeSignature{Int, Tuple{Float32}, Type{Int}}
4444 @test_throws MethodError typed_callable (Int, Int, Int) # arguments type must subtype `Tuple`
4545 end
4646 @testset " arguments type enforcement" begin
4747 @testset " non-`Type`" begin
48- f = typed_callable (Any, Tuple{Int}, - ):: CallableWithTypeSignature
48+ f = typed_callable (- , Any, Tuple{Int}):: CallableWithTypeSignature
4949 @test - 3 === @inferred f (3 )
5050 @test_throws TypeError f (3.0 )
5151 end
5252 @testset " `Type`" begin
53- f = typed_callable (Any, Tuple{Int}, Int8 ):: CallableWithTypeSignature
53+ f = typed_callable (Int8, Any, Tuple{Int}):: CallableWithTypeSignature
5454 @test Int8 (3 ) === @inferred f (3 )
5555 @test_throws TypeError f (3.0 )
5656 end
@@ -59,12 +59,12 @@ using Aqua: Aqua
5959 x_int = Any[3 ]
6060 x_f64 = Any[3.0 ]
6161 @testset " non-`Type`" begin
62- f = typed_callable (Int, Tuple, only ):: CallableWithTypeSignature
62+ f = typed_callable (only, Int, Tuple ):: CallableWithTypeSignature
6363 @test 3 === @inferred f (x_int)
6464 @test_throws TypeError f (x_f64)
6565 end
6666 @testset " `Type`" begin
67- f = typed_callable (Int, Tuple, Int ):: CallableWithTypeSignature
67+ f = typed_callable (Int, Int, Tuple ):: CallableWithTypeSignature
6868 @test 3 === @inferred f (3 )
6969 @test 3 === @inferred f (3.0 )
7070 end
0 commit comments