-
-
Notifications
You must be signed in to change notification settings - Fork 411
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
Nested try
with return
ignores outer then
#2843
Comments
try
with return
ignores outer then
Thanks for this one. It turns out the bug is in the codegen pass in the gen_return function where we only actually generate (actually output this part of the code into the binary) the then clause of the innermost try clause as seen from the return statement. That means in the example above, we immediately return without a value, but only execute the implicit What we need to do is to recurse upward and execute every |
Btw, while investigating this i also found that it is possible to skip a actor Main
new create(env: Env) =>
var i: USize = 0
while i < 10 do
try
i = i + 1
continue // replace with break, same result, then is never executed
then
env.out.print("then")
end
end
env.out.print("done") |
@Shorttail this is fixed on master. thanks for reporting. |
Minimal example:
When a
try
is nested in an outertry
, the outertry
'sthen
block is ignored if the innertry
return
s.The text was updated successfully, but these errors were encountered: