File tree Expand file tree Collapse file tree 1 file changed +4
-26
lines changed
csharp/ql/test/library-tests/csharp9 Expand file tree Collapse file tree 1 file changed +4
-26
lines changed Original file line number Diff line number Diff line change 1
1
import csharp
2
2
3
- private predicate isRealRefTypeConstraint ( Type t ) {
4
- t instanceof RefType and
5
- not t instanceof Interface
6
- }
7
-
8
3
query predicate refType ( TypeParameter tp ) {
9
4
tp .fromSource ( ) and
10
- (
11
- not exists ( tp .getConstraints ( ) )
12
- or
13
- tp .getConstraints ( ) .hasRefTypeConstraint ( )
14
- or
15
- tp .getConstraints ( ) .hasNullableRefTypeConstraint ( )
16
- or
17
- isRealRefTypeConstraint ( tp .getConstraints ( ) .getATypeConstraint ( ) )
18
- )
5
+ tp .isRefType ( )
19
6
}
20
7
21
8
query predicate valueType ( TypeParameter tp ) {
22
9
tp .fromSource ( ) and
23
- (
24
- not exists ( tp .getConstraints ( ) ) or
25
- tp .getConstraints ( ) .hasValueTypeConstraint ( ) or
26
- tp .getConstraints ( ) .getATypeConstraint ( ) instanceof ValueType
27
- )
10
+ tp .isValueType ( )
28
11
}
29
12
30
13
query predicate valueOrRefType ( TypeParameter tp ) {
31
14
tp .fromSource ( ) and
32
- (
33
- not exists ( tp .getConstraints ( ) )
34
- or
35
- not tp .getConstraints ( ) .hasValueTypeConstraint ( ) and
36
- not tp .getConstraints ( ) .hasRefTypeConstraint ( ) and
37
- not isRealRefTypeConstraint ( tp .getConstraints ( ) .getATypeConstraint ( ) )
38
- )
15
+ not tp .isRefType ( ) and
16
+ not tp .isValueType ( )
39
17
}
You can’t perform that action at this time.
0 commit comments