-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
bug in closure capture boxing logic #48889
Labels
compiler:lowering
Syntax lowering (compiler front end, 2nd stage)
kind:bug
Indicates an unexpected problem or unintended behavior
Milestone
Comments
Worth noting that this was first observed using julia> baz = let j=0
@label upper
i = j + 1
println("i == ", i)
if j != 0; @goto lower end
f = ()->i
@label lower
j += 1
if j < 3; @goto upper end
#i
f
end;
i == 1
i == 2
i == 3
julia> baz()
1 |
vchuravy
added
the
compiler:lowering
Syntax lowering (compiler front end, 2nd stage)
label
Mar 6, 2023
3 is the correct answer here, since the binding |
StefanKarpinski
added
the
kind:bug
Indicates an unexpected problem or unintended behavior
label
Mar 6, 2023
JeffBezanson
added a commit
that referenced
this issue
Jul 31, 2023
JeffBezanson
added a commit
that referenced
this issue
Jul 31, 2023
JeffBezanson
added a commit
that referenced
this issue
Aug 9, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
compiler:lowering
Syntax lowering (compiler front end, 2nd stage)
kind:bug
Indicates an unexpected problem or unintended behavior
Notice that
foo()
returns3
.Comment out the line that says
i
, andfoo()
instead returns1
(and its capture is not in aCore.Box
anymore).(ref: Discourse thread)
The text was updated successfully, but these errors were encountered: