anchor.diff:    }
   
     test_error_onClause_nonInterface_void() async {
  -    addTestFile(r'''
  +    await assertErrorsInCode(r'''
   mixin M on void {}
  -''');
  -    await resolveTestFile();
  -
  -    assertTestErrorsWithCodes([
  -      CompileTimeErrorCode.MIXIN_SUPER_CLASS_CONSTRAINT_NON_INTERFACE,
  -      ParserErrorCode.EXPECTED_TYPE_NAME,
  +''', [
  +      error(ParserErrorCode.EXPECTED_TYPE_NAME, 11, 4),
  +      error(CompileTimeErrorCode.MIXIN_SUPER_CLASS_CONSTRAINT_NON_INTERFACE, 11,
  +          4),
       ]);
   
       var element = findElement.mixin('M');
  
positive.code: class C = B with M;
  class D = Object with M2;
  ''');
      await resolveTestFile();
      assertNoTestErrors();
    }
  
    test_error_conflictingStaticAndInstance_inClass_getter_getter() async {
      addTestFile(r'''
  mixin M {
    static int get foo => 0;
    int get foo => 0;
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes(
          [CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE]);
    }
  
    test_error_conflictingStaticAndInstance_inClass_getter_method() async {
      addTestFile(r'''
  mixin M {
    static int get foo => 0;
    void foo() {}
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes(
          [CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE]);
    }
  
    test_error_conflictingStaticAndInstance_inClass_getter_setter() async {
      addTestFile(r'''
  mixin M {
    static int get foo => 0;
    set foo(_) {}
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes(
          [CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE]);
    }
  
    test_error_conflictingStaticAndInstance_inClass_method_getter() async {
      addTestFile(r'''
  mixin M {
    static void foo() {}
    int get foo => 0;
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes(
          [CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE]);
    }
  
    test_error_conflictingStaticAndInstance_inClass_method_method() async {
      addTestFile(r'''
  mixin M {
    static void foo() {}
    void foo() {}
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes(
          [CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE]);
    }
  
    test_error_conflictingStaticAndInstance_inClass_method_setter() async {
      addTestFile(r'''
  mixin M {
    static void foo() {}
    set foo(_) {}
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes(
          [CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE]);
    }
  
    test_error_conflictingStaticAndInstance_inClass_setter_getter() async {
      addTestFile(r'''
  mixin M {
    static set foo(_) {}
    int get foo => 0;
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes(
          [CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE]);
    }
  
    test_error_conflictingStaticAndInstance_inClass_setter_method() async {
      addTestFile(r'''
  mixin M {
    static set foo(_) {}
    void foo() {}
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes(
          [CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE]);
    }
  
    test_error_conflictingStaticAndInstance_inClass_setter_setter() async {
      addTestFile(r'''
  mixin M {
    static set foo(_) {}
    set foo(_) {}
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes(
          [CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE]);
    }
  
    test_error_conflictingStaticAndInstance_inConstraint_getter_getter() async {
      addTestFile(r'''
  class A {
    int get foo => 0;
  }
  mixin M on A {
    static int get foo => 0;
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes(
          [CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE]);
    }
  
    test_error_conflictingStaticAndInstance_inConstraint_getter_method() async {
      addTestFile(r'''
  class A {
    int get foo => 0;
  }
  mixin M on A {
    static void foo() {}
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes(
          [CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE]);
    }
  
    test_error_conflictingStaticAndInstance_inConstraint_getter_setter() async {
      addTestFile(r'''
  class A {
    set foo(_) {}
  }
  mixin M on A {
    static int get foo => 0;
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes(
          [CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE]);
    }
  
    test_error_conflictingStaticAndInstance_inConstraint_method_getter() async {
      addTestFile(r'''
  class A {
    int get foo => 0;
  }
  mixin M on A {
    static void foo() {}
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes(
          [CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE]);
    }
  
    test_error_conflictingStaticAndInstance_inConstraint_method_method() async {
      addTestFile(r'''
  class A {
    void foo() {}
  }
  mixin M on A {
    static void foo() {}
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes(
          [CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE]);
    }
  
    test_error_conflictingStaticAndInstance_inConstraint_method_setter() async {
      addTestFile(r'''
  class A {
    set foo(_) {}
  }
  mixin M on A {
    static void foo() {}
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes(
          [CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE]);
    }
  
    test_error_conflictingStaticAndInstance_inConstraint_setter_method() async {
      addTestFile(r'''
  class A {
    void foo() {}
  }
  mixin M on A {
    static set foo(_) {}
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes(
          [CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE]);
    }
  
    test_error_conflictingStaticAndInstance_inConstraint_setter_setter() async {
      addTestFile(r'''
  class A {
    set foo(_) {}
  }
  mixin M on A {
    static set foo(_) {}
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes(
          [CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE]);
    }
  
    test_error_conflictingStaticAndInstance_inInterface_getter_getter() async {
      addTestFile(r'''
  class A {
    int get foo => 0;
  }
  mixin M implements A {
    static int get foo => 0;
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes(
          [CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE]);
    }
  
    test_error_conflictingStaticAndInstance_inInterface_getter_method() async {
      addTestFile(r'''
  class A {
    int get foo => 0;
  }
  mixin M implements A {
    static void foo() {}
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes(
          [CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE]);
    }
  
    test_error_conflictingStaticAndInstance_inInterface_getter_setter() async {
      addTestFile(r'''
  class A {
    set foo(_) {}
  }
  mixin M implements A {
    static int get foo => 0;
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes(
          [CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE]);
    }
  
    test_error_conflictingStaticAndInstance_inInterface_method_getter() async {
      addTestFile(r'''
  class A {
    int get foo => 0;
  }
  mixin M implements A {
    static void foo() {}
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes(
          [CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE]);
    }
  
    test_error_conflictingStaticAndInstance_inInterface_method_method() async {
      addTestFile(r'''
  class A {
    void foo() {}
  }
  mixin M implements A {
    static void foo() {}
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes(
          [CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE]);
    }
  
    test_error_conflictingStaticAndInstance_inInterface_method_setter() async {
      addTestFile(r'''
  class A {
    set foo(_) {}
  }
  mixin M implements A {
    static void foo() {}
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes(
          [CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE]);
    }
  
    test_error_conflictingStaticAndInstance_inInterface_setter_method() async {
      addTestFile(r'''
  class A {
    void foo() {}
  }
  mixin M implements A {
    static set foo(_) {}
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes(
          [CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE]);
    }
  
    test_error_conflictingStaticAndInstance_inInterface_setter_setter() async {
      addTestFile(r'''
  class A {
    set foo(_) {}
  }
  mixin M implements A {
    static set foo(_) {}
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes(
          [CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE]);
    }
  
    test_error_conflictingTypeVariableAndClass() async {
      addTestFile(r'''
  mixin M<M> {}
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes([
        CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_CLASS,
      ]);
    }
  
    test_error_conflictingTypeVariableAndMember_field() async {
      addTestFile(r'''
  mixin M<T> {
    var T;
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes([
        CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER,
      ]);
    }
  
    test_error_conflictingTypeVariableAndMember_getter() async {
      addTestFile(r'''
  mixin M<T> {
    get T => null;
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes([
        CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER,
      ]);
    }
  
    test_error_conflictingTypeVariableAndMember_method() async {
      addTestFile(r'''
  mixin M<T> {
    T() {}
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes([
        CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER,
      ]);
    }
  
    test_error_conflictingTypeVariableAndMember_method_static() async {
      addTestFile(r'''
  mixin M<T> {
    static T() {}
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes([
        CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER,
      ]);
    }
  
    test_error_conflictingTypeVariableAndMember_setter() async {
      addTestFile(r'''
  mixin M<T> {
    void set T(_) {}
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes([
        CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER,
      ]);
    }
  
    test_error_duplicateDefinition_field() async {
      addTestFile(r'''
  mixin M {
    int t;
    int t;
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes([CompileTimeErrorCode.DUPLICATE_DEFINITION]);
    }
  
    test_error_duplicateDefinition_field_method() async {
      addTestFile(r'''
  mixin M {
    int t;
    void t() {}
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes([CompileTimeErrorCode.DUPLICATE_DEFINITION]);
    }
  
    test_error_duplicateDefinition_getter() async {
      addTestFile(r'''
  mixin M {
    int get t => 0;
    int get t => 0;
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes([CompileTimeErrorCode.DUPLICATE_DEFINITION]);
    }
  
    test_error_duplicateDefinition_getter_method() async {
      addTestFile(r'''
  mixin M {
    int get foo => 0;
    void foo() {}
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes([CompileTimeErrorCode.DUPLICATE_DEFINITION]);
    }
  
    test_error_duplicateDefinition_method() async {
      addTestFile(r'''
  mixin M {
    void t() {}
    void t() {}
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes([CompileTimeErrorCode.DUPLICATE_DEFINITION]);
    }
  
    test_error_duplicateDefinition_method_getter() async {
      addTestFile(r'''
  mixin M {
    void foo() {}
    int get foo => 0;
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes([CompileTimeErrorCode.DUPLICATE_DEFINITION]);
    }
  
    test_error_duplicateDefinition_setter() async {
      addTestFile(r'''
  mixin M {
    void set t(_) {}
    void set t(_) {}
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes([CompileTimeErrorCode.DUPLICATE_DEFINITION]);
    }
  
    test_error_finalNotInitialized() async {
      addTestFile(r'''
  mixin M {
    final int f;
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes([StaticWarningCode.FINAL_NOT_INITIALIZED]);
    }
  
    test_error_finalNotInitialized_OK() async {
      addTestFile(r'''
  mixin M {
    final int f = 0;
  }
  ''');
      await resolveTestFile();
      assertNoTestErrors();
    }
  
    test_error_finalNotInitializedConstructor() async {
      addTestFile(r'''
  mixin M {
    final int f;
    M();
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes([
        CompileTimeErrorCode.MIXIN_DECLARES_CONSTRUCTOR,
        StaticWarningCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_1,
      ]);
    }
  
    test_error_finalNotInitializedConstructor_OK() async {
      addTestFile(r'''
  mixin M {
    final int f;
    M(this.f);
  }
  ''');
      await resolveTestFile();
      assertTestErrorsWithCodes(
          [CompileTimeErrorCode.MIXIN_DECLARES_CONSTRUCTOR]);
  
      var element = findElement.mixin('M');
      var constructorElement = element.constructors.single;
  
negative.code:   x(int y);
  }
  mixin M on A, B {}
  ''', [
        error(CompileTimeErrorCode.INCONSISTENT_INHERITANCE, 67, 1),
      ]);
    }
  
    test_inconsistentInheritance_on_returnType() async {
      await assertErrorsInCode(r'''
  abstract class A {
    int x();
  }
  