Skip to content

Commit c8627b0

Browse files
Apply suggestions from code review
Co-authored-by: Nick Robinson <npr251@gmail.com>
1 parent 193ece3 commit c8627b0

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/global_checks.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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
1313
Checks that the method tables for `rrule` and `frule` are sensible.
1414
This 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)`.
1818
This would then actually define `rrule(::DataType, x)`. (or `UnionAll` if `Foo`
1919
was 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

Comments
 (0)