anchor.diff:    static bool _isLocalParameter(Element element, AstNode node) {
       if (element is ParameterElement) {
         ExecutableElement definingFunction = element.enclosingElement;
  -      AstNode body = node.thisOrAncestorOfType<FunctionBody>();
  -      body ??= node.thisOrAncestorOfType<ConstructorInitializer>();
  -
  -      while (body != null) {
  -        ExecutableElement enclosingFunction;
  -        AstNode parent = body.parent;
  -        if (parent is ConstructorDeclaration) {
  -          enclosingFunction = parent.declaredElement;
  -        } else if (parent is FunctionExpression) {
  -          enclosingFunction = parent.declaredElement;
  -        } else if (parent is MethodDeclaration) {
  -          enclosingFunction = parent.declaredElement;
  +
  +      for (; node != null; node = node.parent) {
  +        if (node is ConstructorDeclaration) {
  +          if (node.declaredElement == definingFunction) {
  +            return true;
  +          }
  +        } else if (node is FunctionExpression) {
  +          if (node.declaredElement == definingFunction) {
  +            return true;
  +          }
  +        } else if (node is MethodDeclaration) {
  +          if (node.declaredElement == definingFunction) {
  +            return true;
  +          }
           }
  -        if (enclosingFunction == definingFunction) {
  -          return true;
  -        }
  -        body = parent?.thisOrAncestorOfType<FunctionBody>();
         }
       }
       return false;
  
positive.code:     }
    }
  
    /// Returns whether [node] is in a declaration context.
    ///
    /// This accounts for field formal parameters as well, whose identifiers do
    /// not consider themselves, for other purposes, to be in a declaration
    /// context.
    bool _inDeclarationContext(SimpleIdentifier node) {
      if (node.inDeclarationContext()) {
        return true;
      }
      var parent = node.parent;
      if (parent is FieldFormalParameter && parent.identifier == node) {
        return true;
      }
      return false;
    }
  
    void _invocationArguments(Element element, ArgumentList arguments) {
      element = element?.declaration;
      if (element is ExecutableElement) {
  
negative.code: 
    void simpleIdentifier(SimpleIdentifier node) {
      // Don't report declared identifiers.
      if (node.inDeclarationContext()) {
        return;
      }
  
  