-
-
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
Strange interaction between return and try/finally #1784
Comments
Yes, finally is not complete yet. This is on my secret todo list, and now it is on my public todo list :) |
Ok, good. |
This does not seem fixed yet: function foo()
(a,b) = try
return true
(0,1)
finally
println("exiting")
end
end gives |
Closed
Seems fixed now? julia> function foo()
(a,b) = try
return true
(0,1)
finally
println("exiting")
end
end
foo (generic function with 1 method)
julia> foo()
exiting
true |
add a test? |
Possible this was fixed by my front-end redesign. |
vtjnash
added a commit
that referenced
this issue
Mar 14, 2016
vtjnash
added a commit
that referenced
this issue
Mar 18, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Discovered through toivoh/Debug.jl#30 :
It seems that
try/finally
doesn't like that you leave the try block usingreturn
.Sometimes it gives a syntax error, as in
Sometimes, it just bypasses the
finally
block, as inTo my mind, both of these examples should print out
"exiting"
, and then return the value 5.The reason that I bring this up is because Debug.jl wraps each scope block in a
try/finally
to make sure to capture when you leave a block, e.g. for step over/out. If the fix is nontrivial, is there some way to work around this issue in the meantime?The text was updated successfully, but these errors were encountered: