You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, a consumed variable in a try block can't be consumed in the associated else block, even if the variable isn't consumed in the erroring path of the try block. For example:
Thanks for the report @Praetonus
This is a known issue and something that is remarkably hard to get right. There are a few issues in this general family.
The "simple" solution is:
actor Main
new create(env: Env) =>
try
partial()
end
consume env
fun partial() ? => error
Currently, a consumed variable in a
try
block can't be consumed in the associatedelse
block, even if the variable isn't consumed in the erroring path of thetry
block. For example:If we enter the
else
here,env
wasn't consumed in thetry
, but the compiler says we can't use a consumed variable.The compiler should find the last erroring operation in a
try
and ignore anything happening after it when checking consumed variables in theelse
.The text was updated successfully, but these errors were encountered: