@@ -2,28 +2,33 @@ struct BadConstructor
2
2
x
3
3
end
4
4
5
- @testset " global_checks.jl" begin
6
- test_method_tables_sensibility ()
5
+ if VERSION >= v " 1.3"
6
+ @testset " global_checks.jl" begin
7
+ test_method_tables_sensibility ()
8
+ ChainRulesCore. rrule (:: typeof (BadConstructor), x) = nothing
9
+ @test fails (test_method_tables_sensibility)
10
+ Base. delete_method (Base. which (rrule, (DataType, Any)))
11
+ test_method_tables_sensibility () # make sure delete worked
7
12
8
- ChainRulesCore. rrule (:: typeof (BadConstructor), x) = nothing
9
- @test fails (test_method_tables_sensibility)
10
- Base. delete_method (Base. which (Tuple{ typeof ( rrule), DataType, Any} ))
11
- test_method_tables_sensibility () # make sure delete worked
13
+ ChainRulesCore. rrule (:: RuleConfig , :: typeof (BadConstructor), x) = nothing
14
+ @test fails (test_method_tables_sensibility)
15
+ Base. delete_method (Base. which (rrule, (RuleConfig, DataType, Any) ))
16
+ test_method_tables_sensibility () # make sure delete worked
12
17
13
- ChainRulesCore. rrule (:: RuleConfig , :: typeof (BadConstructor), x) = nothing
14
- @test fails (test_method_tables_sensibility)
15
- Base. delete_method (Base. which (Tuple{typeof (rrule), RuleConfig, DataType, Any}))
16
- test_method_tables_sensibility () # make sure delete worked
17
18
18
19
20
+ ChainRulesCore. frule (:: Any , :: typeof (BadConstructor), x) = nothing
21
+ @test fails (test_method_tables_sensibility)
22
+ Base. delete_method (Base. which (frule, (Any, DataType, Any)))
23
+ test_method_tables_sensibility () # make sure delete worked
19
24
20
- ChainRulesCore. frule (:: Any , :: typeof (BadConstructor), x) = nothing
21
- @test fails (test_method_tables_sensibility)
22
- Base. delete_method (Base. which (Tuple{ typeof ( frule), Any, DataType, Any} ))
23
- test_method_tables_sensibility () # make sure delete worked
24
-
25
- ChainRulesCore . frule ( :: RuleConfig , :: Any , :: typeof (BadConstructor), x) = nothing
26
- @test fails (test_method_tables_sensibility)
27
- Base . delete_method (Base . which (Tuple{ typeof (frule), RuleConfig, Any, DataType, Any}) )
28
- test_method_tables_sensibility () # make sure delete worked
25
+ ChainRulesCore. frule (:: RuleConfig , :: Any , :: typeof (BadConstructor), x) = nothing
26
+ @test fails (test_method_tables_sensibility)
27
+ Base. delete_method (Base. which (frule, (RuleConfig, Any, DataType, Any) ))
28
+ test_method_tables_sensibility () # make sure delete worked
29
+ end
30
+ else # pre 1.3, so no `delete_method` so just test happy path
31
+ @testset " global_checks.jl " begin
32
+ test_method_tables_sensibility ( )
33
+ end
29
34
end
0 commit comments