public static Environment declareThisWithin ( Decl . FunctionOrMethod decl , Environment environment ) { if ( decl instanceof Decl . Method ) { Decl . Method method = ( Decl . Method ) decl ; environment = environment . declareWithin ( "this" , method . getLifetimes ( ) ) ; } return environment ; }
Update the environment to reflect the fact that the special this lifetime is contained within all declared lifetime parameters . Observe that this only makes sense if the enclosing declaration is for a method .