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
Yes, it is separately a statement and expression. The reason we keep the statement form is that it has unique reachability behavior that is different from other expression-statements. Specifically, its endpoint is not reachable.
Activity
BillWagner commentedon Dec 28, 2016
@MadsTorgersen Is it correct to say that
throwcan be used both as a statement or an expression, or is it always an expression starting in C# 7?MadsTorgersen commentedon Jan 3, 2017
I believe we keep separate notions of throw expressions and throw statements. @gafter may be able to elaborate.
gafter commentedon Jan 3, 2017
Yes, it is separately a statement and expression. The reason we keep the statement form is that it has unique reachability behavior that is different from other expression-statements. Specifically, its endpoint is not reachable.