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
Allow variable declarations under or and not patterns and across case labels in a switch section to share code.
if(e is C c or Wrapper { Prop: C c })returnc;
Expr Simplify(Expre){switch(e){case Mult(Const(1),var x):case Mult(var x, Const(1)):case Add(Const(0),var x):case Add(var x, Const(0)):return Simplify(x);// ..}}
Instead of:
if(e is C c1)returnc1;if(e is Wrapper { Prop: C c2 })returnc2;
Expr Simplify(Expre){switch(e){case Mult(Const(1),var x):return Simplify(x);case Mult(var x, Const(1)):return Simplify(x);case Add(Const(0),var x):return Simplify(x);case Add(var x, Const(0)):return Simplify(x);// ..}}
Also relax single-declaration rules within expression boundaries as long as each variable is assigned once.
if(e is C c || e is Wrapper { Prop: C c });if(b? e is C c : e is Wrapper { Prop: C c });
Also relax single-declaration rules within conditions of an if/else:
if(e is C c){}elseif(e is Wrapper { Prop: C c }){}
Design meetings
The text was updated successfully, but these errors were encountered:
Variable declarations under disjunctive patterns
Summary
Allow variable declarations under
or
andnot
patterns and acrosscase
labels in aswitch
section to share code.Instead of:
Also relax single-declaration rules within expression boundaries as long as each variable is assigned once.
Also relax single-declaration rules within conditions of an
if/else
:Design meetings
The text was updated successfully, but these errors were encountered: