anchor.diff:    }
   
     visitProgram(Program program) {
  -    for (var library in program.libraries) {
  -      for (var class_ in library.classes) {
  -        if (!classes.add(class_)) {
  -          throw 'Class $class_ declared more than once';
  +    try {
  +      for (var library in program.libraries) {
  +        for (var class_ in library.classes) {
  +          if (!classes.add(class_)) {
  +            throw 'Class $class_ declared more than once.';
  +          }
  +        }
  +        library.members.forEach(declareMember);
  +        for (var class_ in library.classes) {
  +          class_.members.forEach(declareMember);
           }
         }
  -      library.members.forEach(declareMember);
  -      for (var class_ in library.classes) {
  -        class_.members.forEach(declareMember);
  +      visitChildren(program);
  +    } finally {
  +      for (var library in program.libraries) {
  +        library.members.forEach(undeclareMember);
  +        for (var class_ in library.classes) {
  +          class_.members.forEach(undeclareMember);
  +        }
         }
  -    }
  -    visitChildren(program);
  -    for (var library in program.libraries) {
  -      library.members.forEach(undeclareMember);
  -      for (var class_ in library.classes) {
  -        class_.members.forEach(undeclareMember);
  -      }
  +      variableStack.forEach(undeclareVariable);
       }
     }
   
  
positive.code:     int stackHeight = enterLocalScope();
      visitChildren(node.function);
      visitList(node.initializers, this);
      exitLocalScope(stackHeight);
      classTypeParametersAreInScope = false;
      visitList(node.annotations, this);
  
negative.code:   final List<VariableDeclaration> variableStack = <VariableDeclaration>[];
    bool classTypeParametersAreInScope = false;
  
    /// If true, relax certain checks for *outline* mode. For example, don't
    /// attempt to validate constructor initializers.
    bool isOutline = false;
  
    Member currentMember;
    Class currentClass;
    TreeNode currentParent;
  