@@ -35,7 +35,7 @@ module Impl {
3535 */
3636 abstract class Call extends ExprImpl:: Expr {
3737 /** Holds if the receiver of this call is implicitly borrowed. */
38- predicate receiverImplicitlyBorrowed ( ) { this .implicitBorrowAt ( TSelfArgumentPosition ( ) ) }
38+ predicate receiverImplicitlyBorrowed ( ) { this .implicitBorrowAt ( TSelfArgumentPosition ( ) , _ ) }
3939
4040 /** Gets the trait targeted by this call, if any. */
4141 abstract Trait getTrait ( ) ;
@@ -47,7 +47,7 @@ module Impl {
4747 abstract Expr getArgument ( ArgumentPosition pos ) ;
4848
4949 /** Holds if the argument at `pos` might be implicitly borrowed. */
50- abstract predicate implicitBorrowAt ( ArgumentPosition pos ) ;
50+ abstract predicate implicitBorrowAt ( ArgumentPosition pos , boolean certain ) ;
5151
5252 /** Gets the number of arguments _excluding_ any `self` argument. */
5353 int getNumberOfArguments ( ) { result = count ( this .getArgument ( TPositionalArgumentPosition ( _) ) ) }
@@ -85,7 +85,7 @@ module Impl {
8585
8686 override Trait getTrait ( ) { none ( ) }
8787
88- override predicate implicitBorrowAt ( ArgumentPosition pos ) { none ( ) }
88+ override predicate implicitBorrowAt ( ArgumentPosition pos , boolean certain ) { none ( ) }
8989
9090 override Expr getArgument ( ArgumentPosition pos ) {
9191 result = super .getArgList ( ) .getArg ( pos .asPosition ( ) )
@@ -109,7 +109,7 @@ module Impl {
109109 qualifier .toString ( ) != "Self"
110110 }
111111
112- override predicate implicitBorrowAt ( ArgumentPosition pos ) { none ( ) }
112+ override predicate implicitBorrowAt ( ArgumentPosition pos , boolean certain ) { none ( ) }
113113
114114 override Expr getArgument ( ArgumentPosition pos ) {
115115 pos .isSelf ( ) and result = super .getArgList ( ) .getArg ( 0 )
@@ -123,7 +123,9 @@ module Impl {
123123
124124 override Trait getTrait ( ) { none ( ) }
125125
126- override predicate implicitBorrowAt ( ArgumentPosition pos ) { pos .isSelf ( ) }
126+ override predicate implicitBorrowAt ( ArgumentPosition pos , boolean certain ) {
127+ pos .isSelf ( ) and certain = false
128+ }
127129
128130 override Expr getArgument ( ArgumentPosition pos ) {
129131 pos .isSelf ( ) and result = this .( MethodCallExpr ) .getReceiver ( )
@@ -143,10 +145,13 @@ module Impl {
143145
144146 override Trait getTrait ( ) { result = trait }
145147
146- override predicate implicitBorrowAt ( ArgumentPosition pos ) {
147- pos .isSelf ( ) and borrows >= 1
148- or
149- pos .asPosition ( ) = 0 and borrows = 2
148+ override predicate implicitBorrowAt ( ArgumentPosition pos , boolean certain ) {
149+ (
150+ pos .isSelf ( ) and borrows >= 1
151+ or
152+ pos .asPosition ( ) = 0 and borrows = 2
153+ ) and
154+ certain = true
150155 }
151156
152157 override Expr getArgument ( ArgumentPosition pos ) {
0 commit comments