@@ -44,9 +44,7 @@ class DataFlowCallable extends TDataFlowCallable {
4444 * inside library callables with a flow summary.
4545 */
4646class DataFlowCall extends ExprNode {
47- DataFlowCall ( ) {
48- this .asExpr ( ) instanceof CallExpr
49- }
47+ DataFlowCall ( ) { this .asExpr ( ) instanceof CallExpr }
5048
5149 /** Gets the enclosing callable. */
5250 DataFlowCallable getEnclosingCallable ( ) { none ( ) }
@@ -59,19 +57,20 @@ private module Cached {
5957
6058 /** Gets a viable run-time target for the call `call`. */
6159 cached
62- DataFlowCallable viableCallable ( DataFlowCall call ) {
60+ DataFlowCallable viableCallable ( DataFlowCall call ) {
6361 result = TDataFlowFunc ( call .asExpr ( ) .( CallExpr ) .getStaticTarget ( ) )
6462 }
6563
6664 cached
6765 newtype TArgumentPosition =
6866 TThisArgument ( ) or
69- TPositionalArgument ( int n ) { n in [ 0 .. 100 ] } // we rely on default exprs generated in the caller for ordering. TODO: compute range properly. TODO: varargs?
67+ // we rely on default exprs generated in the caller for ordering
68+ TPositionalArgument ( int n ) { n = any ( Argument arg ) .getIndex ( ) }
7069
7170 cached
72- newtype TParameterPosition =
73- TThisParameter ( ) or
74- TPositionalParameter ( int n ) { n in [ 0 .. 100 ] } // TODO: compute range properly
71+ newtype TParameterPosition =
72+ TThisParameter ( ) or
73+ TPositionalParameter ( int n ) { n = any ( Argument arg ) . getIndex ( ) }
7574}
7675
7776import Cached
@@ -95,22 +94,17 @@ class ParameterPosition extends TParameterPosition {
9594}
9695
9796class PositionalParameterPosition extends ParameterPosition , TPositionalParameter {
98- int getIndex ( ) {
99- this = TPositionalParameter ( result )
100- }
97+ int getIndex ( ) { this = TPositionalParameter ( result ) }
10198}
10299
103-
104100/** An argument position. */
105101class ArgumentPosition extends TArgumentPosition {
106102 /** Gets a textual representation of this position. */
107103 string toString ( ) { none ( ) }
108104}
109105
110106class PositionalArgumentPosition extends ArgumentPosition , TPositionalArgument {
111- int getIndex ( ) {
112- this = TPositionalArgument ( result )
113- }
107+ int getIndex ( ) { this = TPositionalArgument ( result ) }
114108}
115109
116110/** Holds if arguments at position `apos` match parameters at position `ppos`. */
0 commit comments