-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
lowering: track location of macros better for stackwalk #44995
Conversation
Does this have any relation to #44551? |
No, I would need to change this to |
I would rather try to handle this elsewhere. e.g. wrapping top-level expressions in blocks with line numbers in the parser, instead of putting it inside the macro expansion code. |
b1d0e91
to
8f6c198
Compare
Given that this came up in discussions of #40537, what's the status here? Was #44995 (comment) addressed and it's just waiting for more review? |
I didn't think that would be possible to address, without notable breakage, as it generally is a proposal to change the parsing of any macro call The reason is that many expressions will get to the runtime with the form
Usually, backtraces are okay because the function containing the statements has most of the nearby line numbers marked in the AST nearby, so it does pretty well at getting them right if they are embedded into any sort of block. So this PR tries to add a block in places where we didn't have one. |
c9d6087
to
ea9fde8
Compare
This is now my 4th attempt at this, haha. The main difference is that it is now a little better integrated as part of parsing / lowering and I think that should be a bit more reliable. I think this should happen to also be compatible with #6910, which is a significant advantage too. I would include more bits of that since I have them, but plan to do that in a later PR instead, once I have time to update that content. @nanosoldier |
Your package evaluation job has completed - possible new issues were detected. |
Some notable issues:
I think the best solution here will be to make a slow deprecation cycle here, so that people can fix their hygiene issues, then opt into having line info correct (there are a lot of tests that rely on macros not being able to track line numbers because they test explicitly that parsing and evaluating a macro from different lines gives egal results). So we can add a |
Oh sigh. TryCatch.jl and WatchJuliaBurn.jl fail because I stopped having |
This is to preserve the line number. But we make slightly more changes than strictly necessary to prepare for future improvements in this area.
ea9fde8
to
ad5d6d5
Compare
This now gives up entirely on fixing |
Thanks, @vtjnash! Looking forward to trying this out. |
Noticed since
scrub_backtrace
is looking for amacro expansion
whenprinting an exception thrown in
@test
, but that was missing for simpleexpressions, particularly those at the top-level or spliced in.
Fix #44757