@@ -14,11 +14,12 @@ private import TypeRef
14
14
/**
15
15
* A variable. Either a variable with local scope (`LocalScopeVariable`) or a field (`Field`).
16
16
*/
17
- class Variable extends Assignable , DotNet :: Variable , @variable {
17
+ class Variable extends Assignable , @variable {
18
18
override Variable getUnboundDeclaration ( ) { result = this }
19
19
20
20
override VariableAccess getAnAccess ( ) { result .getTarget ( ) = this }
21
21
22
+ /** Gets the type of this variable. */
22
23
override Type getType ( ) { none ( ) }
23
24
24
25
/** Gets the expression used to initialise this variable, if any. */
@@ -87,9 +88,10 @@ class LocalScopeVariable extends Variable, @local_scope_variable {
87
88
* }
88
89
* ```
89
90
*/
90
- class Parameter extends DotNet:: Parameter , LocalScopeVariable , Attributable , TopLevelExprParent ,
91
- @parameter
92
- {
91
+ class Parameter extends LocalScopeVariable , Attributable , TopLevelExprParent , @parameter {
92
+ /** Gets the raw position of this parameter, including the `this` parameter at index 0. */
93
+ final int getRawPosition ( ) { this = this .getDeclaringElement ( ) .getRawParameter ( result ) }
94
+
93
95
/**
94
96
* Gets the position of this parameter. For example, the position of `x` is
95
97
* 0 and the position of `y` is 1 in
@@ -100,7 +102,7 @@ class Parameter extends DotNet::Parameter, LocalScopeVariable, Attributable, Top
100
102
* }
101
103
* ```
102
104
*/
103
- override int getPosition ( ) { params ( this , _, _, result , _, _, _) }
105
+ int getPosition ( ) { params ( this , _, _, result , _, _, _) }
104
106
105
107
override int getIndex ( ) { result = this .getPosition ( ) }
106
108
@@ -138,7 +140,7 @@ class Parameter extends DotNet::Parameter, LocalScopeVariable, Attributable, Top
138
140
* }
139
141
* ```
140
142
*/
141
- override predicate isOut ( ) { params ( this , _, _, _, 2 , _, _) }
143
+ predicate isOut ( ) { params ( this , _, _, _, 2 , _, _) }
142
144
143
145
/**
144
146
* Holds if this parameter is a value type that is passed in by reference.
@@ -193,7 +195,7 @@ class Parameter extends DotNet::Parameter, LocalScopeVariable, Attributable, Top
193
195
predicate hasExtensionMethodModifier ( ) { params ( this , _, _, _, 4 , _, _) }
194
196
195
197
/** Gets the declaring element of this parameter. */
196
- override Parameterizable getDeclaringElement ( ) { params ( this , _, _, _, _, result , _) }
198
+ Parameterizable getDeclaringElement ( ) { params ( this , _, _, _, _, result , _) }
197
199
198
200
override Parameter getUnboundDeclaration ( ) { params ( this , _, _, _, _, _, result ) }
199
201
@@ -396,9 +398,7 @@ class LocalConstant extends LocalVariable, @local_constant {
396
398
* }
397
399
* ```
398
400
*/
399
- class Field extends Variable , AssignableMember , Attributable , TopLevelExprParent , DotNet:: Field ,
400
- @field
401
- {
401
+ class Field extends Variable , AssignableMember , Attributable , TopLevelExprParent , @field {
402
402
/**
403
403
* Gets the initial value of this field, if any. For example, the initial
404
404
* value of `F` on line 2 is `20` in
0 commit comments