Make DefaultCase include NullDefaultCase

This commit is contained in:
Chris Smowton
2023-11-16 14:32:06 +00:00
parent d2ff1baff0
commit 6e868d21bd
4 changed files with 13 additions and 21 deletions

View File

@@ -1535,7 +1535,7 @@ class SwitchExpr extends Expr, StmtParent, @switchexpr {
*
* Note this may be `default` or `case null, default`.
*/
SwitchCase getDefaultCase() { result = this.getACase() and result.hasDefaultLabel() }
DefaultCase getDefaultCase() { result = this.getACase() }
/** Gets the expression of this `switch` expression. */
Expr getExpr() { result.getParent() = this }
@@ -1738,9 +1738,7 @@ class LocalVariableDeclExpr extends Expr, @localvariabledeclexpr {
/** A local variable declaration that occurs within a record pattern. */
class RecordBindingVariableExpr extends LocalVariableDeclExpr {
RecordBindingVariableExpr() {
this.getParent() instanceof RecordPatternExpr
}
RecordBindingVariableExpr() { this.getParent() instanceof RecordPatternExpr }
}
/** An update of a variable or an initialization of the variable. */