Files
codeql/csharp/ql/test/library-tests/expressions/As1.ql
2018-08-02 17:53:23 +01:00

14 lines
363 B
Plaintext

/**
* @name Test for as expressions
*/
import csharp
from Method m, AsExpr e
where m.hasName("MainIsAsCast")
and e.getEnclosingCallable() = m
and e.getExpr().(ParameterAccess).getTarget().getName() = "o"
and e.getTargetType().(Class).hasQualifiedName("Expressions.Class")
and e.getEnclosingStmt().getParent().getParent() instanceof IfStmt
select m, e