anchor.diff:    }
   
     test_newWithInvalidTypeParameters() async {
  -    Source source = addSource(r'''
  +    await assertErrorsInCode('''
   class A {}
  -f() { return new A<A>(); }''');
  -    await computeAnalysisResult(source);
  -    assertErrors(source, [StaticWarningCode.NEW_WITH_INVALID_TYPE_PARAMETERS]);
  -    verify([source]);
  +f() { return new A<A>(); }''', [
  +      error(StaticWarningCode.NEW_WITH_INVALID_TYPE_PARAMETERS, 28, 4),
  +    ]);
     }
   
     test_newWithInvalidTypeParameters_tooFew() async {
  -    Source source = addSource(r'''
  +    await assertErrorsInCode('''
   class A {}
   class C<K, V> {}
   f(p) {
     return new C<A>();
  -}''');
  -    await computeAnalysisResult(source);
  -    assertErrors(source, [StaticWarningCode.NEW_WITH_INVALID_TYPE_PARAMETERS]);
  -    verify([source]);
  +}''', [
  +      error(StaticWarningCode.NEW_WITH_INVALID_TYPE_PARAMETERS, 48, 4),
  +    ]);
     }
   
     test_newWithInvalidTypeParameters_tooMany() async {
  -    Source source = addSource(r'''
  +    await assertErrorsInCode('''
   class A {}
   class C<E> {}
   f(p) {
     return new C<A, A>();
  -}''');
  -    await computeAnalysisResult(source);
  -    assertErrors(source, [StaticWarningCode.NEW_WITH_INVALID_TYPE_PARAMETERS]);
  -    verify([source]);
  +}''', [
  +      error(StaticWarningCode.NEW_WITH_INVALID_TYPE_PARAMETERS, 45, 7),
  +    ]);
     }
   
     test_newWithNonType() async {
  -    Source source = addSource(r'''
  +    await assertErrorsInCode('''
   var A = 0;
   void f() {
     var a = new A();
  -}''');
  -    await computeAnalysisResult(source);
  -    assertErrors(source, [StaticWarningCode.NEW_WITH_NON_TYPE]);
  -    verify([source]);
  +}''', [
  +      error(HintCode.UNUSED_LOCAL_VARIABLE, 28, 1),
  +      error(StaticWarningCode.NEW_WITH_NON_TYPE, 36, 1),
  +    ]);
     }
   
     test_newWithNonType_fromLibrary() async {
  -    Source source1 = addNamedSource("/lib.dart", "class B {}");
  -    Source source2 = addNamedSource("/lib2.dart", r'''
  +    newFile("/test/lib/lib.dart", content: "class B {}");
  +    await assertErrorsInCode('''
   import 'lib.dart' as lib;
   void f() {
     var a = new lib.A();
   }
  -lib.B b;''');
  -    await computeAnalysisResult(source1);
  -    await computeAnalysisResult(source2);
  -    assertErrors(source2, [StaticWarningCode.NEW_WITH_NON_TYPE]);
  -    verify([source1]);
  +lib.B b;''', [
  +      error(HintCode.UNUSED_LOCAL_VARIABLE, 43, 1),
  +      error(StaticWarningCode.NEW_WITH_NON_TYPE, 55, 1),
  +    ]);
     }
   
     test_newWithUndefinedConstructor() async {
  -    Source source = addSource(r'''
  +    await assertErrorsInCode('''
   class A {
     A() {}
   }
   f() {
     new A.name();
  -}''');
  -    await computeAnalysisResult(source);
  -    assertErrors(source, [StaticWarningCode.NEW_WITH_UNDEFINED_CONSTRUCTOR]);
  -    // no verify(), 'name' is not resolved
  +}''', [
  +      error(StaticWarningCode.NEW_WITH_UNDEFINED_CONSTRUCTOR, 35, 4),
  +    ]);
     }
   
     test_newWithUndefinedConstructorDefault() async {
  -    Source source = addSource(r'''
  +    await assertErrorsInCode('''
   class A {
     A.name() {}
   }
   f() {
     new A();
  -}''');
  -    await computeAnalysisResult(source);
  -    assertErrors(
  -        source, [StaticWarningCode.NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT]);
  -    verify([source]);
  +}''', [
  +      error(StaticWarningCode.NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT, 38, 1),
  +    ]);
     }
   
     test_nonAbstractClassInheritsAbstractMemberFivePlus() async {
  -    Source source = addSource(r'''
  +    await assertErrorsInCode('''
   abstract class A {
     m();
     n();
  
positive.code:   m();
  }
  class B extends A implements I {
  }''');
      await computeAnalysisResult(source);
      assertErrors(source,
          [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
      verify([source]);
    }
  
    test_nonAbstractClassInheritsAbstractMemberOne_setter_and_implicitSetter() async {
      // test from language/override_inheritance_abstract_test_14.dart
      Source source = addSource(r'''
  abstract class A {
    set field(_);
  }
  
negative.code: class A {
    N m() { return null; }
  }
  class B<T extends N> {}''', [
        error(StaticWarningCode.AMBIGUOUS_IMPORT, 48, 1),
        error(StaticWarningCode.AMBIGUOUS_IMPORT, 53, 1),
        error(StaticWarningCode.AMBIGUOUS_IMPORT, 59, 1),
        error(StaticWarningCode.AMBIGUOUS_IMPORT, 63, 1),
        error(StaticWarningCode.AMBIGUOUS_IMPORT, 72, 1),
        error(HintCode.UNUSED_LOCAL_VARIABLE, 74, 1),
        error(StaticWarningCode.AMBIGUOUS_IMPORT, 106, 1),
        error(StaticWarningCode.AMBIGUOUS_IMPORT, 149, 1),
      ]);
    }
  
    test_ambiguousImport_typeArgument_annotation() async {
      newFile("/test/lib/lib1.dart", content: '''
  library lib1;
  class N {}''');
      newFile("/test/lib/lib2.dart", content: '''
  library lib2;
  class N {}''');
      await assertErrorsInCode('''
  import 'lib1.dart';
  import 'lib2.dart';
  class A<T> {}
  A<N> f() { return null; }''', [
        error(StaticWarningCode.AMBIGUOUS_IMPORT, 56, 1),
      ]);
    }
  
    test_ambiguousImport_typeArgument_instanceCreation() async {
      newFile("/test/lib/lib1.dart", content: '''
  library lib1;
  class N {}''');
      newFile("/test/lib/lib2.dart", content: '''
  library lib2;
  class N {}''');
      await assertErrorsInCode('''
  import 'lib1.dart';
  import 'lib2.dart';
  class A<T> {}
  f() {new A<N>();}''', [
        error(StaticWarningCode.AMBIGUOUS_IMPORT, 65, 1),
      ]);
    }
  
    test_ambiguousImport_varRead() async {
      newFile("/test/lib/lib1.dart", content: '''
  library lib1;
  var v;''');
      newFile("/test/lib/lib2.dart", content: '''
  library lib2;
  var v;''');
      await assertErrorsInCode('''
  import 'lib1.dart';
  import 'lib2.dart';
  f() { g(v); }
  g(p) {}''', [
        error(StaticWarningCode.AMBIGUOUS_IMPORT, 48, 1),
      ]);
    }
  
    test_ambiguousImport_varWrite() async {
      newFile("/test/lib/lib1.dart", content: '''
  library lib1;
  var v;''');
      newFile("/test/lib/lib2.dart", content: '''
  library lib2;
  var v;''');
      await assertErrorsInCode('''
  import 'lib1.dart';
  import 'lib2.dart';
  f() { v = 0; }''', [
        error(StaticWarningCode.AMBIGUOUS_IMPORT, 46, 1),
      ]);
    }
  
    test_argumentTypeNotAssignable_ambiguousClassName() async {
      // See dartbug.com/19624
      newFile("/test/lib/lib2.dart", content: '''
  class _A {}
  g(h(_A a)) {}''');
      await assertErrorsInCode('''
  import 'lib2.dart';
  class _A {}
  f() {
    g((_A a) {});
  }''', [
        error(StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 42, 9),
      ]);
      // The name _A is private to the library it's defined in, so this is a type
      // mismatch. Furthermore, the error message should mention both _A and the
      // filenames so the user can figure out what's going on.
      String message = result.errors[0].message;
      expect(message.indexOf("_A") >= 0, isTrue);
    }
  
    test_argumentTypeNotAssignable_annotation_namedConstructor() async {
      await assertErrorsInCode('''
  class A {
    const A.fromInt(int p);
  }
  @A.fromInt('0')
  main() {
  }''', [
        error(StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 49, 3),
      ]);
    }
  
    test_argumentTypeNotAssignable_annotation_unnamedConstructor() async {
      await assertErrorsInCode('''
  class A {
    const A(int p);
  }
  @A('0')
  main() {
  }''', [
        error(StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 33, 3),
      ]);
    }
  
    test_argumentTypeNotAssignable_binary() async {
      await assertErrorsInCode('''
  class A {
    operator +(int p) {}
  }
  f(A a) {
    a + '0';
  }''', [
        error(StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 50, 3),
      ]);
    }
  
    test_argumentTypeNotAssignable_call() async {
      await assertErrorsInCode('''
  typedef bool Predicate<T>(T object);
  
  Predicate<String> f() => null;
  
  void main() {
    f().call(3);
  }''', [
        error(StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 95, 1),
      ]);
    }
  
    test_argumentTypeNotAssignable_cascadeSecond() async {
      await assertErrorsInCode('''
  // filler filler filler filler filler filler filler filler filler filler
  class A {
    B ma() { return new B(); }
  