anchor.diff:  
     @override
     visitClassDeclaration(ClassDeclaration node) {
  -    _assertLegacyType(node.element?.type);
  +    _assertLegacyType(node.declaredElement?.type);
       super.visitClassDeclaration(node);
     }
   
     @override
     visitClassMember(ClassMember node) {
  -    final element = node.element;
  +    final element = node.declaredElement;
       if (element is ExecutableElement) {
         _assertLegacyType(element?.type);
       }
  
positive.code: 
    @override
    visitFormalParameter(FormalParameter node) {
      _assertLegacyType(node.element?.type);
      super.visitFormalParameter(node);
    }
  
    @override
    visitFunctionDeclaration(FunctionDeclaration node) {
      _assertLegacyType(node.element?.type);
      super.visitFunctionDeclaration(node);
    }
  
  
negative.code: 
    @override
    visitVariableDeclaration(VariableDeclaration node) {
      _assertLegacyType(node.declaredElement?.type);
      super.visitVariableDeclaration(node);
    }
  
  