anchor.diff:    void visitVariableDeclaration(VariableDeclaration node) {
       var variableElement = node.declaredElement;
       var parent = node.parent;
  -    if (variableElement != null &&
  +    if (variableElement is PropertyInducingElement &&
           parent is VariableDeclarationList &&
  -        parent.type == null &&
  -        node.initializer != null) {
  -      if (variableElement.kind == ElementKind.TOP_LEVEL_VARIABLE ||
  -          variableElement.kind == ElementKind.FIELD) {
  -        _validateTopLevelInitializer(variableElement.name!, node.initializer!);
  +        parent.type == null) {
  +      var initializer = node.initializer;
  +      if (initializer != null) {
  +        _validateTopLevelInitializer(variableElement.name, initializer);
         }
       }
       node.visitChildren(this);
  
positive.code: 
    @override
    void visitForPartsWithDeclarations(ForPartsWithDeclarations node) {
      if (node.condition != null) {
        checkBoolean(node.condition!);
      }
      node.visitChildren(this);
    }
  
    @override
    void visitForPartsWithExpression(ForPartsWithExpression node) {
      if (node.condition != null) {
        checkBoolean(node.condition!);
      }
      node.visitChildren(this);
    }
  
negative.code:       }
  
        var e = _getKnownElement(expr);
        if (e is FunctionElement) {
          _recordMessage(expr, CompileTimeErrorCode.INVALID_CAST_FUNCTION,
              [e.name, from, to]);
        } else if (e is MethodElement && e.isStatic) {
          _recordMessage(
              expr, CompileTimeErrorCode.INVALID_CAST_METHOD, [e.name, from, to]);
        }
      }
    }
  