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
Copy file name to clipboardExpand all lines: change-notes/1.21/analysis-csharp.md
+15-1Lines changed: 15 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,10 +9,24 @@
9
9
10
10
## Changes to code extraction
11
11
12
-
* Named attribute arguments are now extracted.
12
+
* The following C# 8 features are now extracted:
13
+
- Range expressions
14
+
- Recursive patterns
13
15
14
16
## Changes to QL libraries
15
17
16
18
* The class `Attribute` has two new predicates: `getConstructorArgument()` and `getNamedArgument()`. The first predicate returns arguments to the underlying constructor call and the latter returns named arguments for initializing fields and properties.
19
+
* The following QL classes have been added to model C# 8 features:
20
+
- Class `IndexExpr` models from-end index expressions, for example `^1`
21
+
- Class `PatternExpr` is an `Expr` that appears in a pattern. It has the new subclasses `DiscardPatternExpr`, `LabeledPatternExpr`, `RecursivePatternExpr`, `TypeAccessPatternExpr`, `TypePatternExpr`, and `VariablePatternExpr`.
22
+
- Class `PatternMatch` models a pattern being matched. It has the subclasses `Case` and `IsExpr`.
23
+
- Class `PositionalPatternExpr` models position patterns, for example `(int x, int y)`
24
+
- Class `PropertyPatternExpr` models property patterns, for example `Length: int len`
25
+
- Class `RangeExpr` models range expressions, for example `1..^1`
26
+
- Class `SwitchCaseExpr` models the arm of a switch expression, for example `(false, false) => true`
27
+
- Class `SwitchExpr` models `switch` expressions, for example `(a, b) switch { ... }`
28
+
- Classes `IsConstantExpr`, `IsTypeExpr` and `IsPatternExpr` are deprecated in favour of `IsExpr`
29
+
- Class `Switch` models both `SwitchExpr` and `SwitchStmt`
30
+
- Class `Case` models both `CaseStmt` and `SwitchCaseExpr`
/// <param name="child">The child index of this pattern.</param>
98
+
/// <param name="isTopLevel">If this pattern is in the top level of a case/is. In that case, the variable and type access are populated elsewhere.</param>
0 commit comments