Skip to content

Commit 2cafbdc

Browse files
Merge branch 'master' into condensed_fields
2 parents 93858fc + a060e87 commit 2cafbdc

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/abbreviations.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ function format(::TypedMethodSignatures, buf, doc)
388388
end
389389
end
390390

391-
if Sys.iswindows()
391+
@static if Sys.iswindows() && VERSION < v"1.8"
392392
t = tuples[findlast(f, tuples)]
393393
else
394394
t = tuples[findfirst(f, tuples)]

src/utilities.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ function keywords(func, m::Method)
419419
# table is a MethodTable object. For some reason, the :kwsorter field is not always
420420
# defined. An undefined kwsorter seems to imply that there are no methods in the
421421
# MethodTable with keyword arguments.
422-
if isdefined(table, :kwsorter)
422+
if !(Base.fieldindex(Core.MethodTable, :kwsorter, false) > 0) || isdefined(table, :kwsorter)
423423
# Fetching method keywords stolen from base/replutil.jl:572-576 (commit 3b45cdc9aab0):
424424
kwargs = VERSION < v"1.4.0-DEV.215" ? Base.kwarg_decl(m, typeof(table.kwsorter)) : Base.kwarg_decl(m)
425425
if isa(kwargs, Vector) && length(kwargs) > 0
@@ -463,7 +463,7 @@ function arguments(m::Method)
463463
local args = map(argnames[1:nargs(m)]) do arg
464464
arg === Symbol("#unused#") ? "_" : arg
465465
end
466-
return filter(arg -> arg !== Symbol("#self#"), args)
466+
return filter(arg -> arg !== Symbol("#self#") && arg !== Symbol("#ctor-self#"), args)
467467
end
468468
return Symbol[]
469469
end

test/tests.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ end
4242
@test isdefined(methods(M.j_1), :mt)
4343
local mt = methods(M.j_1).mt
4444
@test isa(mt, Core.MethodTable)
45-
@test isdefined(mt, :kwsorter)
45+
if Base.fieldindex(Core.MethodTable, :kwsorter, false) > 0
46+
@test isdefined(mt, :kwsorter)
47+
end
4648
# .kwsorter is not always defined -- namely, it seems when none of the methods
4749
# have keyword arguments:
4850
@test isdefined(methods(M.f).mt, :kwsorter) === false
@@ -200,10 +202,8 @@ end
200202
@test occursin("\n```julia\n", str)
201203
f = str -> replace(str, " " => "")
202204
str = f(str)
203-
204-
if VERSION < v"1.1" && Sys.iswindows()
205-
# on Windows, Julia 1.0 sorts Array{T,n} within Union in reverse order
206-
@test_broken occursin(f("h_1(\nx::Union{Array{T,3}, Array{T,4}} where T\n) -> Union{Array{T,3}, Array{T,4}} where T"), str)
205+
if Sys.iswindows() && VERSION < v"1.8"
206+
@test occursin(f("h_1(\nx::Union{Array{T,4}, Array{T,3}} where T\n) -> Union{Array{T,4}, Array{T,3}} where T"), str)
207207
else
208208
@test occursin(f("h_1(\nx::Union{Array{T,3}, Array{T,4}} where T\n) -> Union{Array{T,3}, Array{T,4}} where T"), str)
209209
end

0 commit comments

Comments
 (0)