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

21 lines
650 B
Plaintext

/**
* @name Test for delegates
*/
import csharp
from DelegateType d
where
d.hasFullyQualifiedName("Delegates", "FooDelegate") and
d.getReturnType() instanceof DoubleType and
d.getParameter(0).hasName("param") and
d.getParameter(0).isRef() and
d.getParameter(0).getType() instanceof StringType and
d.getParameter(1).getName() = "condition" and
d.getParameter(1).isOut() and
d.getParameter(1).getType() instanceof BoolType and
d.getParameter(2).hasName("args") and
d.getParameter(2).isParams() and
d.getParameter(2).getType().(ArrayType).getElementType() instanceof StringType
select d, d.getAParameter().getType().toString()