Skip to content

Fixes for nightly#176

Merged
mortenpi merged 6 commits into
JuliaDocs:masterfrom
serenity4:fix-nightly
Jun 6, 2025
Merged

Fixes for nightly#176
mortenpi merged 6 commits into
JuliaDocs:masterfrom
serenity4:fix-nightly

Conversation

@serenity4

Copy link
Copy Markdown
Contributor

Method table internals changed in JuliaLang/julia@1735d8f, breaking our former reliance on (::MethodList).mt.

The associated error was originally observed here.

Comment thread src/utilities.jl Outdated

@mortenpi mortenpi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR LGTM, just some opinionated code style changes.

Comment thread src/utilities.jl Outdated
Comment thread src/utilities.jl Outdated
Comment thread src/utilities.jl
# table is a MethodTable object. For some reason, the :kwsorter field is not always
# defined. An undefined kwsorter seems to imply that there are no methods in the
# MethodTable with keyword arguments.
if !(Base.fieldindex(Core.MethodTable, :kwsorter, false) > 0) || isdefined(table, :kwsorter)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure that removing the fieldindex part is safe? I am not sure why it's here in the first place.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure either. If isdefined(table, :kwsorter) returns true, fieldindex should have returned a strictly positive index anyways.

Perhaps this is a remnant of a time where we used to only check statically for the type (with fieldindex), and later we wanted to check for instances and added the isdefined check, without removing the former.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like it got added very intentionally in https://github.com/JuliaDocs/DocStringExtensions.jl/pull/137/files But the theory is that it's not relevant for <= 1.4?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It got added here for "1.0 support".

#137 (comment)

cc @MichaelHatherly -- any memories from 3 years ago? 😄

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just thinking a bit more: I think Base.fieldindex(Core.MethodTable, :kwsorter, false) > 0 is always true (specifically, Base.fieldindex(Core.MethodTable, :kwsorter, false) == 5) on < 1.4. So I think #176 (comment) just has no effect in the refactored code. But doesn't hurt either.

Comment thread src/utilities.jl Outdated
Comment thread src/utilities.jl Outdated
@mortenpi

mortenpi commented Jun 6, 2025

Copy link
Copy Markdown
Member

Thank you @serenity4!

@mortenpi mortenpi merged commit a84ff78 into JuliaDocs:master Jun 6, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants