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
As recently noted by C# users, the existing restriction that you cannot yield a value in the body of a try block with a catch clause is one that interferes with reasonable code refactoring. The restriction does not make the compiler any easier. Rather it was added to align with the conceptual model that the caller's loop is logically "called" at the point of the yield. But that is not how people think of the construct, and the restriction has little value. We propose to remove it.
Design meetings
The text was updated successfully, but these errors were encountered:
Remove error "Cannot yield a value in the body of a try block with a catch clause"
Summary
As recently noted by C# users, the existing restriction that you cannot yield a value in the body of a try block with a catch clause is one that interferes with reasonable code refactoring. The restriction does not make the compiler any easier. Rather it was added to align with the conceptual model that the caller's loop is logically "called" at the point of the
yield
. But that is not how people think of the construct, and the restriction has little value. We propose to remove it.Design meetings
The text was updated successfully, but these errors were encountered: