Skip to content

Commit b5ea34f

Browse files
committed
C#: We can't do any reasoning based on unknown types on whether they match in a pattern.
1 parent 5c0fc1f commit b5ea34f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

csharp/ql/lib/semmle/code/csharp/controlflow/internal/Completion.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,8 @@ private predicate isMatchingConstant(PatternExpr pe, boolean value) {
293293
value = true
294294
or
295295
exists(Type t, Type strippedType |
296+
not t instanceof UnknownType and
297+
not strippedType instanceof UnknownType and
296298
typePatternMustHaveMatchingCompletion(pe, t, strippedType) and
297299
not typePatternCommonSubType(t, strippedType) and
298300
value = false

0 commit comments

Comments
 (0)