-
-
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
Use GlobalRef
of Core.CodeInfo
in @generated
#43823
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's a test case that currently errors on nightly:
@test @eval Module() begin
Core = 1
@generated f() = 1
f() == 1
end
🤦 I realized I couldn't come up with a MWE because I used Julia 1.7.1 instead of 1.6.5 or master. |
Co-authored-by: Simeon Schaub <schaub@mit.edu>
I added a fix for arguments of name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! That's a great first contribution!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I actually meant to approve this...
Co-authored-by: Simeon Schaub <schaub@mit.edu>
Co-authored-by: Simeon Schaub <schaub@mit.edu>
Co-authored-by: Simeon Schaub <schaub@mit.edu>
This PR addresses https://github.com/JuliaLang/julia/pull/40778/files#r784416018 and replaces the reference to
Core.CodeInfo
in@generated
with aGlobalRef
.The current implementation caused errors in Turing (TuringLang/Turing.jl#1756) which collected core AD parts in a
Core
submodule (not anymore, it's renamed toEssential
now since it's not the first time this caused problems: simonster/Reexport.jl#33 (comment)).Currently the PR is still missing some tests. It's a bit embarrassing but I did not manage to come up with a MWE that would be fixed by this PR. I tried things like
but they all seemed to work fine. Maybe someone has a suggestion how I can reproduce the bug and ensure that
Core
in@generated
refers to the submodule (or something else) withoutCodeInfo
?