File tree Expand file tree Collapse file tree
csharp/ql/lib/semmle/code/csharp/dataflow/internal Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1984,6 +1984,21 @@ private class DataFlowUnknownType extends DataFlowType {
19841984 DataFlowUnknownType ( ) { this = Gvn:: getGlobalValueNumber ( any ( UnknownType ut ) ) }
19851985}
19861986
1987+ private predicate uselessTypebound ( DataFlowType t ) {
1988+ t instanceof DataFlowUnknownType or
1989+ t instanceof Gvn:: TypeParameterGvnType
1990+ }
1991+
1992+ pragma [ nomagic]
1993+ predicate typeStrongerThan ( DataFlowType t1 , DataFlowType t2 ) {
1994+ t1 != t2 and
1995+ t1 = getANonTypeParameterSubTypeRestricted ( t2 )
1996+ or
1997+ t1 instanceof RelevantDataFlowType and
1998+ not uselessTypebound ( t1 ) and
1999+ uselessTypebound ( t2 )
2000+ }
2001+
19872002/**
19882003 * Holds if `t1` and `t2` are compatible, that is, whether data can flow from
19892004 * a node of type `t1` to a node of type `t2`.
You can’t perform that action at this time.
0 commit comments