Skip to content

add @__FUNCTION__ macro #841

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jul 29, 2025
Merged

Conversation

MilesCranmer
Copy link
Member

JuliaLang/julia#58940

The macro implemented here differs slightly because it needs to refer to the internal variable var"#self#", rather than the new Expr(:thisfunction) directive, as the later required parser changes to expand compatibility with callable structs.

However, the only change this means in practice is that the Compat version will throw an error in cases where the Julia 1.13.0-DEV.880 version would work. So there would not be any silent differences; only very obvious ones. I have mentioned these cases on the Compat version docstring.

@MilesCranmer
Copy link
Member Author

@martinholters let me know if you have any comments. I'm eager to get this merged as I need it in a package

Copy link
Member

@martinholters martinholters 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 the restrictions mentioned in the docstring will go largely unnoticed. Maybe add a sentence to the README, pointing to the docstring for details?

@MilesCranmer
Copy link
Member Author

Thanks, done!

Copy link

codecov bot commented Jul 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.78%. Comparing base (743ee8c) to head (da64166).

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #841       +/-   ##
===========================================
+ Coverage   50.00%   91.78%   +41.78%     
===========================================
  Files           2        2               
  Lines         458      487       +29     
===========================================
+ Hits          229      447      +218     
+ Misses        229       40      -189     

☔ 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.

@MilesCranmer
Copy link
Member Author

@martinholters sorry for pinging but just wanted to check-in on this (usually I only have time to code on the weekend these days)

@martinholters martinholters merged commit 9477a24 into JuliaLang:master Jul 29, 2025
21 checks passed
@MilesCranmer MilesCranmer deleted the function-macro branch July 29, 2025 16:46
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