Skip to content

Conversation

@JamesWrigley
Copy link
Member

@JamesWrigley JamesWrigley commented Dec 21, 2025

@KristofferC, @mlechu, this is a more invasive but reliable (I think) solution to #600. Can confirm that it fixes the invalidations from parse_brackets() on 1.12 for InitialValues.jl (though there's a plethora of others). If y'all think it's a good idea I can make a PR to the main repo.

@codecov
Copy link

codecov bot commented Dec 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (backports-julialang-1.12@4168cde). Learn more about missing BASE report.

Additional details and impacted files
@@                     Coverage Diff                     @@
##             backports-julialang-1.12     #615   +/-   ##
===========================================================
  Coverage                            ?   96.91%           
===========================================================
  Files                               ?       14           
  Lines                               ?     4380           
  Branches                            ?        0           
===========================================================
  Hits                                ?     4245           
  Misses                              ?      135           
  Partials                            ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@c42f c42f left a comment

Choose a reason for hiding this comment

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

I think this is fine if we need it. Though I'd prefer a less invasive alternative if we want to keep the code idiomatic for future Julia versions (assuming 1.13 doesn't suffer from this?)

The simplest least invasive way could be to type assert the type of opts as soon as it's returned? Then the performance hacking is localized in one place?

end
end

@kwdef mutable struct ParseUnaryBracketOpts
Copy link
Member

@c42f c42f Dec 23, 2025

Choose a reason for hiding this comment

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

Couple of notes:

  1. Why are these options structs mutable?
  2. Unfortunately @kwdef doesn't exist on older julia versions

Comment on lines +1293 to 1296
return ParseUnaryBracketOpts(; needs_parameters=is_paren_call,
is_paren_call=is_paren_call,
is_block=!is_paren_call && num_semis > 0)
end
Copy link
Member

Choose a reason for hiding this comment

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

Does this do the trick?

Suggested change
return ParseUnaryBracketOpts(; needs_parameters=is_paren_call,
is_paren_call=is_paren_call,
is_block=!is_paren_call && num_semis > 0)
end
return (needs_parameters=is_paren_call,
is_paren_call=is_paren_call,
is_block=!is_paren_call && num_semis > 0)
end
opts::NamedTuple{(:needs_parameters, :is_paren_call, :is_block), Tuple{Bool, Bool, Bool}}

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