@@ -519,10 +519,12 @@ import ArgumentPassing
519519 */
520520newtype TDataFlowCallable =
521521 TCallableValue ( CallableValue callable ) {
522- callable instanceof FunctionValue
522+ callable instanceof FunctionValue and
523+ not callable .( FunctionValue ) .isLambda ( )
523524 or
524525 callable instanceof ClassValue
525526 } or
527+ TLambda ( Function lambda ) { lambda .isLambda ( ) } or
526528 TModule ( Module m )
527529
528530/** Represents a callable. */
@@ -565,6 +567,27 @@ class DataFlowCallableValue extends DataFlowCallable, TCallableValue {
565567 override CallableValue getCallableValue ( ) { result = callable }
566568}
567569
570+ /** A class representing a callable lambda. */
571+ class DataFlowLambda extends DataFlowCallable , TLambda {
572+ Function lambda ;
573+
574+ DataFlowLambda ( ) { this = TLambda ( lambda ) }
575+
576+ override string toString ( ) { result = lambda .toString ( ) }
577+
578+ override CallNode getACall ( ) { result = getCallableValue ( ) .getACall ( ) }
579+
580+ override Scope getScope ( ) { result = lambda .getEvaluatingScope ( ) }
581+
582+ override NameNode getParameter ( int n ) { result = getParameter ( getCallableValue ( ) , n ) }
583+
584+ override string getName ( ) { result = "Lambda callable" }
585+
586+ override FunctionValue getCallableValue ( ) {
587+ result .getOrigin ( ) .getNode ( ) = lambda .getDefinition ( )
588+ }
589+ }
590+
568591/** A class representing the scope in which a `ModuleVariableNode` appears. */
569592class DataFlowModuleScope extends DataFlowCallable , TModule {
570593 Module mod ;
0 commit comments