@@ -123,28 +123,28 @@ class BooleanCompletion extends ConditionalCompletion, TBooleanCompletion {
123
123
override string toString ( ) { result = "boolean(" + value + ")" }
124
124
}
125
125
126
- /** Holds if `pat` is guaranteed to match. */
126
+ /** Holds if `pat` is guaranteed to match at the point in the AST where it occurs . */
127
127
pragma [ nomagic]
128
- private predicate isIrrefutablePattern ( Pat pat ) {
128
+ private predicate isExhaustiveMatch ( Pat pat ) {
129
129
(
130
130
pat instanceof WildcardPat
131
131
or
132
132
pat = any ( IdentPat ip | not ip .hasPat ( ) and ip = any ( Variable v ) .getPat ( ) )
133
133
or
134
134
pat instanceof RestPat
135
135
or
136
- // `let` statements without an `else` branch must be irrefutible
136
+ // `let` statements without an `else` branch must be exhaustive
137
137
pat = any ( LetStmt let | not let .hasLetElse ( ) ) .getPat ( )
138
138
or
139
- // `match` expressions must be irrefutible , so last arm cannot fail
139
+ // `match` expressions must be exhaustive , so last arm cannot fail
140
140
pat = any ( MatchExpr me ) .getLastArm ( ) .getPat ( )
141
141
or
142
- // parameter patterns must be irrefutible
142
+ // parameter patterns must be exhaustive
143
143
pat = any ( Param p ) .getPat ( )
144
144
) and
145
145
not pat = any ( ForExpr for ) .getPat ( ) // workaround until `for` loops are desugared
146
146
or
147
- exists ( Pat parent | isIrrefutablePattern ( parent ) |
147
+ exists ( Pat parent | isExhaustiveMatch ( parent ) |
148
148
pat = parent .( BoxPat ) .getPat ( )
149
149
or
150
150
pat = parent .( IdentPat ) .getPat ( )
@@ -171,7 +171,7 @@ class MatchCompletion extends TMatchCompletion, ConditionalCompletion {
171
171
172
172
override predicate isValidForSpecific ( AstNode e ) {
173
173
e instanceof Pat and
174
- if isIrrefutablePattern ( e ) then value = true else any ( )
174
+ if isExhaustiveMatch ( e ) then value = true else any ( )
175
175
}
176
176
177
177
override MatchSuccessor getAMatchingSuccessorType ( ) { result .getValue ( ) = value }
0 commit comments