File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -419,7 +419,7 @@ function keywords(func, m::Method)
419
419
# table is a MethodTable object. For some reason, the :kwsorter field is not always
420
420
# defined. An undefined kwsorter seems to imply that there are no methods in the
421
421
# MethodTable with keyword arguments.
422
- if isdefined (table, :kwsorter )
422
+ if ! hasfield (Core . MethodTable, :kwsorter ) || isdefined (table, :kwsorter )
423
423
# Fetching method keywords stolen from base/replutil.jl:572-576 (commit 3b45cdc9aab0):
424
424
kwargs = VERSION < v " 1.4.0-DEV.215" ? Base. kwarg_decl (m, typeof (table. kwsorter)) : Base. kwarg_decl (m)
425
425
if isa (kwargs, Vector) && length (kwargs) > 0
@@ -463,7 +463,7 @@ function arguments(m::Method)
463
463
local args = map (argnames[1 : nargs (m)]) do arg
464
464
arg === Symbol (" #unused#" ) ? " _" : arg
465
465
end
466
- return filter (arg -> arg != = Symbol (" #self#" ), args)
466
+ return filter (arg -> arg != = Symbol (" #self#" ) && arg != = Symbol ( " #ctor-self# " ) , args)
467
467
end
468
468
return Symbol[]
469
469
end
Original file line number Diff line number Diff line change 42
42
@test isdefined (methods (M. j_1), :mt )
43
43
local mt = methods (M. j_1). mt
44
44
@test isa (mt, Core. MethodTable)
45
- @test isdefined (mt, :kwsorter )
45
+ if hasfield (Core. MethodTable, :kwsorter )
46
+ @test isdefined (mt, :kwsorter )
47
+ end
46
48
# .kwsorter is not always defined -- namely, it seems when none of the methods
47
49
# have keyword arguments:
48
50
@test isdefined (methods (M. f). mt, :kwsorter ) === false
You can’t perform that action at this time.
0 commit comments