@@ -8,17 +8,17 @@ _parameters(sig::DataType) = sig.parameters
88_parameters (sig:: Union ) = Base. uniontypes (sig)
99
1010"""
11- test_method_tables_sensibility ()
11+ test_method_tables ()
1212
1313Checks that the method tables for `rrule` and `frule` are sensible.
1414This in future may carry out a number of checks, but presently just checks to make sure that
15- no rules have been added to the very general `DataType`, `Union` or `UnionAll` types.
16- This is easy to do when writing rules for constructors.
17- It happens if you writeg. `rrule(::typeof(Foo), x)` rather than `rrule(::Type{<:Foo}, x)`:
15+ no rules have been added to the very general `DataType`, `Union` or `UnionAll` types,
16+ which is easy to do accidentally when writing rules for constructors.
17+ It happens if you write e.g. `rrule(::typeof(Foo), x)` rather than `rrule(::Type{<:Foo}, x)`.
1818This would then actually define `rrule(::DataType, x)`. (or `UnionAll` if `Foo`
1919was parametric, or `Union` if `Foo` was a type alias for a `Union`)
2020"""
21- function test_method_tables_sensibility ()
21+ function test_method_tables ()
2222 @testset " Sensible Constructors" begin
2323 # if someone wrote e.g. `rrule(::typeof(Foo), x)` rather than
2424 # `rrule(::Type{<:Foo}, x)` then that would actually define `rrule(::DataType, x)`
@@ -33,7 +33,7 @@ function test_method_tables_sensibility()
3333 end
3434
3535 @test_msg (
36- " Bad constructor rrule. typeof(T) used rather than `Type{T}`. $method " ,
36+ " Bad constructor rrule. ` typeof(T)` used rather than `Type{T}`. $method " ,
3737 function_type ∉ (DataType, UnionAll, Union)
3838 )
3939 end
@@ -48,7 +48,7 @@ function test_method_tables_sensibility()
4848 end
4949
5050 @test_msg (
51- " Bad constructor frule. typeof(T) used rather than `Type{T}`. $method " ,
51+ " Bad constructor frule. ` typeof(T)` used rather than `Type{T}`. $method " ,
5252 function_type ∉ (DataType, UnionAll, Union)
5353 )
5454 end
0 commit comments