-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This will diagnose a common typo of omitting a comma in a switch expression.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -308,7 +308,7 @@ relational-expression | |
; | ||
|
||
case-expression | ||
: relational-expression 'case' pattern ':' shift-expression | ||
: shift-expression 'case' pattern ':' shift-expression | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
alrz
Member
|
||
; | ||
``` | ||
|
||
|
@@ -492,9 +492,9 @@ Expr Simplify(Expr e) | |
var areas = | ||
from primitive in primitives | ||
let area = primitive switch ( | ||
case Line l: 0 | ||
case Rectangle r: r.Width * r.Height | ||
case Circle c: Math.PI * c.Radius * c.Radius | ||
case Line l: 0, | ||
case Rectangle r: r.Width * r.Height, | ||
case Circle c: Math.PI * c.Radius * c.Radius, | ||
case *: throw new ApplicationException() | ||
) | ||
select new { Primitive = primitive, Area = area }; | ||
|
What is the use case of this being pattern? Shouldn't it be complex-pattern?