Fix Julia 1.12 compatibility for MethodList API change#217
Merged
cstjean merged 2 commits intoFluxML:masterfrom Dec 29, 2025
Merged
Conversation
In Julia 1.12, `Base.MethodList` no longer has the `mt` field. Use `nameof(f)` for Julia >= 1.12 to get the function name. Fixes FluxML#216 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
ChrisRackauckas
approved these changes
Dec 29, 2025
Member
ChrisRackauckas
left a comment
There was a problem hiding this comment.
I checked this and the change seems reasonable.
Collaborator
|
I don't mind merging this as is, but a test would be nice. |
Test that prettify correctly resolves function references (like $sin) to their symbolic names (sin). This exercises the unresolve functionality which was fixed for Julia 1.12 compatibility. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Author
|
Added a test for @testset "prettify" begin
@test MacroTools.prettify(:($sin(2))) == :(sin(2))
@test MacroTools.prettify(:($cos(x))) == :(cos(x))
endAll 167 tests pass locally on Julia 1.12.3. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FieldError: type Base.MethodList has no field mton Julia 1.12nameof(f)for Julia >= 1.12, originalmethods(f).mt.namefor older versionsprettifyandunresolvefunctions now work correctly on Julia 1.12Test plan
MacroTools.prettify(Expr(:call, +, 1, 2))on Julia 1.12.3Fixes #216
🤖 Generated with Claude Code