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
Inside the catch portion of a try / catch with some restrictions on the presence of finally
Motivation
This is a long standing pain point in iterators that customers bring up with some regularity. The restriction exists largely because of limitations in the native compiler state machine rewriting code at the point iterators were implemented. The Roslyn compiler is capable of performing this type of rewrite, mostly through the innovations around async method state machines. Given that we should remove this restriction to make iterators more flexible.
yield inside of try / catch
Summary
This expands the use of
yield
so it is permitted:try
portion of atry / catch
blockcatch
portion of atry / catch
with some restrictions on the presence offinally
Motivation
This is a long standing pain point in iterators that customers bring up with some regularity. The restriction exists largely because of limitations in the native compiler state machine rewriting code at the point iterators were implemented. The Roslyn compiler is capable of performing this type of rewrite, mostly through the innovations around
async
method state machines. Given that we should remove this restriction to make iterators more flexible.Detailed design
Full details are in the proposal document.
#8413
Design meetings
The text was updated successfully, but these errors were encountered: