mirror of
https://github.com/github/codeql.git
synced 2026-02-24 02:43:40 +01:00
Don't regard cases with multiple patterns as conducting a type test
This commit is contained in:
@@ -213,13 +213,13 @@ class Guard extends ExprParent {
|
||||
or
|
||||
exists(PatternCase pc | this = pc |
|
||||
pc.getSelectorExpr() = testedExpr and
|
||||
testedType = pc.getPattern().getType()
|
||||
testedType = pc.getUniquePattern().getType()
|
||||
)
|
||||
) and
|
||||
(
|
||||
if
|
||||
exists(RecordPatternExpr rpe |
|
||||
rpe = [this.(InstanceOfExpr).getPattern(), this.(PatternCase).getPattern()]
|
||||
rpe = [this.(InstanceOfExpr).getPattern(), this.(PatternCase).getAPattern()]
|
||||
|
|
||||
not rpe.isUnrestricted()
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user