File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed
csharp/ql/src/semmle/code/csharp/controlflow/internal Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -269,19 +269,16 @@ private predicate typePatternCommonSubType(Type t, Type strippedType) {
269269 * constantly non-matches (`value = false`).
270270 */
271271private predicate isMatchingConstant ( PatternExpr pe , boolean value ) {
272- exists ( Expr e | mustHaveMatchingCompletion ( e , pe ) |
273- exists ( Expr stripped | stripped = e .stripCasts ( ) |
274- exists ( string strippedValue , string patternValue |
275- strippedValue = stripped .getValue ( ) and
276- patternValue = pe .getValue ( ) and
277- if strippedValue = patternValue then value = true else value = false
278- )
279- )
280- or
281- pe instanceof DiscardPatternExpr and
282- value = true
272+ exists ( Expr e , string exprValue , string patternValue |
273+ mustHaveMatchingCompletion ( e , pe ) and
274+ exprValue = e .stripCasts ( ) .getValue ( ) and
275+ patternValue = pe .getValue ( ) and
276+ if exprValue = patternValue then value = true else value = false
283277 )
284278 or
279+ pe instanceof DiscardPatternExpr and
280+ value = true
281+ or
285282 exists ( Type t , Type strippedType |
286283 typePatternMustHaveMatchingCompletion ( pe , t , strippedType ) and
287284 not typePatternCommonSubType ( t , strippedType ) and
You can’t perform that action at this time.
0 commit comments