@@ -19,6 +19,7 @@ private import semmle.code.csharp.frameworks.system.Collections
1919private import semmle.code.csharp.frameworks.system.threading.Tasks
2020private import semmle.code.cil.Ssa:: Ssa as CilSsa
2121private import semmle.code.cil.internal.SsaImpl as CilSsaImpl
22+ import codeql.util.Unit
2223
2324/** Gets the callable in which this node occurs. */
2425DataFlowCallable nodeGetEnclosingCallable ( NodeImpl n ) { result = n .getEnclosingCallableImpl ( ) }
@@ -2163,15 +2164,6 @@ int accessPathLimit() { result = 5 }
21632164 */
21642165predicate forceHighPrecision ( Content c ) { c instanceof ElementContent }
21652166
2166- /** The unit type. */
2167- private newtype TUnit = TMkUnit ( )
2168-
2169- /** The trivial type with a single element. */
2170- class Unit extends TUnit {
2171- /** Gets a textual representation of this element. */
2172- string toString ( ) { result = "unit" }
2173- }
2174-
21752167class LambdaCallKind = Unit ;
21762168
21772169/** Holds if `creation` is an expression that creates a delegate for `c`. */
@@ -2183,7 +2175,7 @@ predicate lambdaCreation(ExprNode creation, LambdaCallKind kind, DataFlowCallabl
21832175 e .( AddressOfExpr ) .getOperand ( ) .( CallableAccess ) .getTarget ( ) .getUnboundDeclaration ( )
21842176 ]
21852177 ) and
2186- kind = TMkUnit ( )
2178+ exists ( kind )
21872179}
21882180
21892181private class LambdaConfiguration extends ControlFlowReachabilityConfiguration {
@@ -2214,7 +2206,7 @@ predicate lambdaCall(DataFlowCall call, LambdaCallKind kind, Node receiver) {
22142206 or
22152207 receiver = call .( SummaryCall ) .getReceiver ( )
22162208 ) and
2217- kind = TMkUnit ( )
2209+ exists ( kind )
22182210}
22192211
22202212/** Extra data-flow steps needed for lambda flow analysis. */
0 commit comments