diff --git a/python/ql/lib/semmle/python/controlflow/internal/AstNodeImpl.qll b/python/ql/lib/semmle/python/controlflow/internal/AstNodeImpl.qll index 8a6c7cf81c52..1747b6cdd1a0 100644 --- a/python/ql/lib/semmle/python/controlflow/internal/AstNodeImpl.qll +++ b/python/ql/lib/semmle/python/controlflow/internal/AstNodeImpl.qll @@ -993,9 +993,8 @@ module Ast implements AstSig { } } - /** A wildcard case (`case _:`). */ class DefaultCase extends Case { - DefaultCase() { this.isWildcard() } + DefaultCase() { none() } } /** A conditional expression (`x if cond else y`). */ @@ -1754,6 +1753,11 @@ private module Input implements InputSig1, InputSig2 { n2.isAdditional(assertStmt, assertThrowTag()) ) } + + predicate matchAll(Ast::Case c) { + // A wildcard case (`case _:`) will match all values. + c.isWildcard() + } } import Public