|
40 | 40 | # Its signature is kwarg_decl(m::Method, kwtype::DataType). The second argument |
41 | 41 | # should be the type of the kwsorter from the corresponding MethodTable. |
42 | 42 | @test isa(methods(M.j_1), Base.MethodList) |
43 | | - @test isdefined(methods(M.j_1), :mt) |
44 | | - local mt = methods(M.j_1).mt |
| 43 | + get_mt(func) = VERSION ≥ v"1.13.0-DEV.647" ? Core.GlobalMethods : methods(func).mt |
| 44 | + local mt = get_mt(M.j_1) |
45 | 45 | @test isa(mt, Core.MethodTable) |
46 | 46 | if Base.fieldindex(Core.MethodTable, :kwsorter, false) > 0 |
47 | 47 | @test isdefined(mt, :kwsorter) |
48 | 48 | end |
49 | 49 | # .kwsorter is not always defined -- namely, it seems when none of the methods |
50 | 50 | # have keyword arguments: |
51 | | - @test isdefined(methods(M.f).mt, :kwsorter) === false |
| 51 | + @test isdefined(get_mt(M.f), :kwsorter) === false |
52 | 52 | # M.j_1 has two methods. Fetch the single argument one.. |
53 | 53 | local m = which(M.j_1, (Any,)) |
54 | 54 | @test isa(m, Method) |
|
61 | 61 | # that does not have any arguments |
62 | 62 | m = which(M.j_1, (Any,Any)) # fetch the no-keyword method |
63 | 63 | if VERSION < v"1.4.0-DEV.215" |
64 | | - @test Base.kwarg_decl(m, typeof(methods(M.j_1).mt.kwsorter)) == Tuple{}() |
| 64 | + @test Base.kwarg_decl(m, typeof(get_mt(M.j_1).kwsorter)) == Tuple{}() |
65 | 65 | else |
66 | 66 | @test Base.kwarg_decl(m) == [] |
67 | 67 | end |
|
83 | 83 | DSE.format(IMPORTS, buf, doc) |
84 | 84 | str = String(take!(buf)) |
85 | 85 | @test occursin("\n - `Base`\n", str) |
86 | | - @test occursin("\n - `Core`\n", str) |
| 86 | + if VERSION < v"1.13-DEV" |
| 87 | + @test occursin("\n - `Core`\n", str) |
| 88 | + end |
87 | 89 |
|
88 | 90 | # Module exports. |
89 | 91 | DSE.format(EXPORTS, buf, doc) |
|
0 commit comments