Files
codeql/csharp/ql/test/library-tests/expressions/Is1.ql
2023-11-10 08:46:15 +01:00

15 lines
355 B
Plaintext

/**
* @name Test for is expressions
*/
import csharp
from Method m, IsExpr e, TypePatternExpr tpe
where
m.hasName("MainIsAsCast") and
e.getEnclosingCallable() = m and
e.getExpr().(ParameterAccess).getTarget().getName() = "o" and
tpe = e.getPattern() and
tpe.getCheckedType().(Class).hasFullyQualifiedName("Expressions", "Class")
select m, e