File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
src/utils/model-generator/internal
test/utils/model-generator Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -17,14 +17,24 @@ module TaintTracking = CS::TaintTracking;
17
17
18
18
class Type = CS:: Type ;
19
19
20
+ /**
21
+ * Holds if any of the parameters of `api` are `System.Func<>`.
22
+ */
23
+ private predicate isHigherOrder ( CS:: Callable api ) {
24
+ exists ( Type t | t = api .getAParameter ( ) .getType ( ) .getUnboundDeclaration ( ) |
25
+ t instanceof System:: SystemFuncDelegateType
26
+ )
27
+ }
28
+
20
29
/**
21
30
* Holds if it is relevant to generate models for `api`.
22
31
*/
23
32
private predicate isRelevantForModels ( CS:: Callable api ) {
24
33
[ api .( CS:: Modifiable ) , api .( CS:: Accessor ) .getDeclaration ( ) ] .isEffectivelyPublic ( ) and
25
34
api .getDeclaringType ( ) .getNamespace ( ) .getQualifiedName ( ) != "" and
26
35
not api instanceof CS:: ConversionOperator and
27
- not api instanceof Util:: MainMethod
36
+ not api instanceof Util:: MainMethod and
37
+ not isHigherOrder ( api )
28
38
}
29
39
30
40
/**
Original file line number Diff line number Diff line change @@ -85,4 +85,17 @@ public Int32 M4(Int32 i)
85
85
{
86
86
return i ;
87
87
}
88
+ }
89
+
90
+ public class HigherOrderParameters
91
+ {
92
+ public string M1 ( string s , Func < string , string > map )
93
+ {
94
+ return s ;
95
+ }
96
+
97
+ public object M2 ( Func < object , object > map , object o )
98
+ {
99
+ return map ( o ) ;
100
+ }
88
101
}
You can’t perform that action at this time.
0 commit comments