Files
codeql/csharp/ql/test/library-tests/statements/LocalConstDecl1.ql
2019-11-14 17:14:51 +00:00

16 lines
440 B
Plaintext

/**
* @name Test for local variable declaration statement
*/
import csharp
from Method m, LocalConstantDeclStmt s, LocalConstantDeclExpr e
where
m.getName() = "MainLocalConstDecl" and
s.getEnclosingCallable() = m and
s.getAVariableDeclExpr() = e and
e.getVariable().getName() = "pi" and
e.getVariable().getType() instanceof FloatType and
e.getInitializer() instanceof FloatLiteral
select m, s, e, e.getVariable().getValue()