anchor.diff:      typeProvider = analysisContext.typeProvider;
       typeSystem = analysisContext.typeSystem;
     }
  -}
  -
  -@reflectiveTest
  -class AssignabilityTest extends AbstractTypeSystemTest {
  -  void test_isAssignableTo_bottom_isBottom() {
  -    DartType interfaceType = ElementFactory.classElement2('A', []).type;
  -    List<DartType> interassignable = <DartType>[
  -      dynamicType,
  -      objectType,
  -      intType,
  -      doubleType,
  -      numType,
  -      stringType,
  -      interfaceType,
  -      bottomType
  -    ];
  -
  -    _checkGroups(bottomType, interassignable: interassignable);
  -  }
  -
  -  void test_isAssignableTo_call_method() {
  -    ClassElementImpl classBottom = ElementFactory.classElement2("B");
  -    MethodElement methodBottom =
  -        ElementFactory.methodElement("call", objectType, <DartType>[intType]);
  -    classBottom.methods = <MethodElement>[methodBottom];
  -
  -    DartType top =
  -        TypeBuilder.function(required: <DartType>[intType], result: objectType);
  -    InterfaceType bottom = classBottom.type;
  -
  -    _checkIsStrictAssignableTo(bottom, top);
  -  }
  -
  -  void test_isAssignableTo_classes() {
  -    ClassElement classTop = ElementFactory.classElement2("A");
  -    ClassElement classLeft = ElementFactory.classElement("B", classTop.type);
  -    ClassElement classRight = ElementFactory.classElement("C", classTop.type);
  -    ClassElement classBottom = ElementFactory.classElement("D", classLeft.type)
  -      ..interfaces = <InterfaceType>[classRight.type];
  -    InterfaceType top = classTop.type;
  -    InterfaceType left = classLeft.type;
  -    InterfaceType right = classRight.type;
  -    InterfaceType bottom = classBottom.type;
  -
  -    _checkLattice(top, left, right, bottom);
  -  }
  -
  -  void test_isAssignableTo_double() {
  -    DartType interfaceType = ElementFactory.classElement2('A', []).type;
  -    List<DartType> interassignable = <DartType>[
  -      dynamicType,
  -      objectType,
  -      doubleType,
  -      numType,
  -      bottomType
  -    ];
  -    List<DartType> unrelated = <DartType>[
  -      intType,
  -      stringType,
  -      interfaceType,
  -    ];
  -
  -    _checkGroups(doubleType,
  -        interassignable: interassignable, unrelated: unrelated);
  -  }
  -
  -  void test_isAssignableTo_dynamic_isTop() {
  -    DartType interfaceType = ElementFactory.classElement2('A', []).type;
  -    List<DartType> interassignable = <DartType>[
  -      dynamicType,
  -      objectType,
  -      intType,
  -      doubleType,
  -      numType,
  -      stringType,
  -      interfaceType,
  -      bottomType
  -    ];
  -    _checkGroups(dynamicType, interassignable: interassignable);
  -  }
  -
  -  void test_isAssignableTo_generics() {
  -    ClassElementImpl LClass = ElementFactory.classElement2('L', ["T"]);
  -    InterfaceType LType = LClass.type;
  -    ClassElementImpl MClass = ElementFactory.classElement2('M', ["T"]);
  -    DartType typeParam = MClass.typeParameters[0].type;
  -    InterfaceType superType = LType.instantiate(<DartType>[typeParam]);
  -    MClass.interfaces = <InterfaceType>[superType];
  -    InterfaceType MType = MClass.type;
  -
  -    InterfaceType top = LType.instantiate(<DartType>[dynamicType]);
  -    InterfaceType left = MType.instantiate(<DartType>[dynamicType]);
  -    InterfaceType right = LType.instantiate(<DartType>[intType]);
  -    InterfaceType bottom = MType.instantiate(<DartType>[intType]);
  -
  -    _checkCrossLattice(top, left, right, bottom);
  -  }
  -
  -  void test_isAssignableTo_int() {
  -    DartType interfaceType = ElementFactory.classElement2('A', []).type;
  -    List<DartType> interassignable = <DartType>[
  -      dynamicType,
  -      objectType,
  -      intType,
  -      numType,
  -      bottomType
  -    ];
  -    List<DartType> unrelated = <DartType>[
  -      doubleType,
  -      stringType,
  -      interfaceType,
  -    ];
  -
  -    _checkGroups(intType,
  -        interassignable: interassignable, unrelated: unrelated);
  -  }
  -
  -  void test_isAssignableTo_named_optional() {
  -    DartType r =
  -        TypeBuilder.function(required: <DartType>[intType], result: intType);
  -    DartType o = TypeBuilder.function(
  -        required: <DartType>[], optional: <DartType>[intType], result: intType);
  -    DartType n = TypeBuilder.function(
  -        required: <DartType>[],
  -        named: <String, DartType>{'x': intType},
  -        result: intType);
  -    DartType rr = TypeBuilder.function(
  -        required: <DartType>[intType, intType], result: intType);
  -    DartType ro = TypeBuilder.function(
  -        required: <DartType>[intType],
  -        optional: <DartType>[intType],
  -        result: intType);
  -    DartType rn = TypeBuilder.function(
  -        required: <DartType>[intType],
  -        named: <String, DartType>{'x': intType},
  -        result: intType);
  -    DartType oo = TypeBuilder.function(
  -        required: <DartType>[],
  -        optional: <DartType>[intType, intType],
  -        result: intType);
  -    DartType nn = TypeBuilder.function(
  -        required: <DartType>[],
  -        named: <String, DartType>{'x': intType, 'y': intType},
  -        result: intType);
  -    DartType nnn = TypeBuilder.function(
  -        required: <DartType>[],
  -        named: <String, DartType>{'x': intType, 'y': intType, 'z': intType},
  -        result: intType);
  -
  -    _checkGroups(r,
  -        interassignable: [r, o, ro, rn, oo], unrelated: [n, rr, nn, nnn]);
  -    _checkGroups(o,
  -        interassignable: [o, oo], unrelated: [n, rr, ro, rn, nn, nnn]);
  -    _checkGroups(n,
  -        interassignable: [n, nn, nnn], unrelated: [r, o, rr, ro, rn, oo]);
  -    _checkGroups(rr,
  -        interassignable: [rr, ro, oo], unrelated: [r, o, n, rn, nn, nnn]);
  -    _checkGroups(ro, interassignable: [ro, oo], unrelated: [o, n, rn, nn, nnn]);
  -    _checkGroups(rn,
  -        interassignable: [rn], unrelated: [o, n, rr, ro, oo, nn, nnn]);
  -    _checkGroups(oo, interassignable: [oo], unrelated: [n, rn, nn, nnn]);
  -    _checkGroups(nn,
  -        interassignable: [nn, nnn], unrelated: [r, o, rr, ro, rn, oo]);
  -    _checkGroups(nnn,
  -        interassignable: [nnn], unrelated: [r, o, rr, ro, rn, oo]);
  -  }
  -
  -  void test_isAssignableTo_num() {
  -    DartType interfaceType = ElementFactory.classElement2('A', []).type;
  -    List<DartType> interassignable = <DartType>[
  -      dynamicType,
  -      objectType,
  -      numType,
  -      intType,
  -      doubleType,
  -      bottomType
  -    ];
  -    List<DartType> unrelated = <DartType>[
  -      stringType,
  -      interfaceType,
  -    ];
  -
  -    _checkGroups(numType,
  -        interassignable: interassignable, unrelated: unrelated);
  -  }
  -
  -  void test_isAssignableTo_simple_function() {
  -    FunctionType top =
  -        TypeBuilder.function(required: <DartType>[intType], result: objectType);
  -    FunctionType left =
  -        TypeBuilder.function(required: <DartType>[intType], result: intType);
  -    FunctionType right = TypeBuilder.function(
  -        required: <DartType>[objectType], result: objectType);
  -    FunctionType bottom =
  -        TypeBuilder.function(required: <DartType>[objectType], result: intType);
  -
  -    _checkCrossLattice(top, left, right, bottom);
  -  }
  -
  -  void test_isAssignableTo_void_functions() {
  -    FunctionType top =
  -        TypeBuilder.function(required: <DartType>[intType], result: voidType);
  -    FunctionType bottom =
  -        TypeBuilder.function(required: <DartType>[objectType], result: intType);
  -
  -    _checkEquivalent(bottom, top);
  -  }
  -
  -  void _checkCrossLattice(
  -      DartType top, DartType left, DartType right, DartType bottom) {
  -    _checkGroups(top, interassignable: [top, left, right, bottom]);
  -    _checkGroups(left,
  -        interassignable: [top, left, bottom], unrelated: [right]);
  -    _checkGroups(right,
  -        interassignable: [top, right, bottom], unrelated: [left]);
  -    _checkGroups(bottom, interassignable: [top, left, right, bottom]);
  -  }
  -
  -  void _checkEquivalent(DartType type1, DartType type2) {
  -    _checkIsAssignableTo(type1, type2);
  -    _checkIsAssignableTo(type2, type1);
  -  }
  -
  -  void _checkGroups(DartType t1,
  -      {List<DartType> interassignable, List<DartType> unrelated}) {
  -    if (interassignable != null) {
  -      for (DartType t2 in interassignable) {
  -        _checkEquivalent(t1, t2);
  -      }
  -    }
  -    if (unrelated != null) {
  -      for (DartType t2 in unrelated) {
  -        _checkUnrelated(t1, t2);
  -      }
  -    }
  -  }
  -
  -  void _checkIsAssignableTo(DartType type1, DartType type2) {
  -    expect(typeSystem.isAssignableTo(type1, type2), true);
  -  }
  -
  -  void _checkIsNotAssignableTo(DartType type1, DartType type2) {
  -    expect(typeSystem.isAssignableTo(type1, type2), false);
  -  }
  -
  -  void _checkIsStrictAssignableTo(DartType type1, DartType type2) {
  -    _checkIsAssignableTo(type1, type2);
  -    _checkIsNotAssignableTo(type2, type1);
  -  }
  -
  -  void _checkLattice(
  -      DartType top, DartType left, DartType right, DartType bottom) {
  -    _checkGroups(top, interassignable: <DartType>[top, left, right, bottom]);
  -    _checkGroups(left,
  -        interassignable: <DartType>[top, left, bottom],
  -        unrelated: <DartType>[right]);
  -    _checkGroups(right,
  -        interassignable: <DartType>[top, right, bottom],
  -        unrelated: <DartType>[left]);
  -    _checkGroups(bottom, interassignable: <DartType>[top, left, right, bottom]);
  -  }
  -
  -  void _checkUnrelated(DartType type1, DartType type2) {
  -    _checkIsNotAssignableTo(type1, type2);
  -    _checkIsNotAssignableTo(type2, type1);
  -  }
  -}
  -
  -/**
  - * Base class for testing LUB and GLB in spec and strong mode.
  - */
  -abstract class BoundTestBase extends AbstractTypeSystemTest {
  -  FunctionType simpleFunctionType;
  -
  -  void setUp() {
  -    super.setUp();
  -    simpleFunctionType = FunctionTypeImpl.synthetic(
  -      voidType,
  -      const <TypeParameterElement>[],
  -      const <ParameterElement>[],
  -    );
  -  }
  -
  -  void _checkGreatestLowerBound(
  -      DartType type1, DartType type2, DartType expectedResult) {
  -    DartType glb = typeSystem.getGreatestLowerBound(type1, type2);
  -    expect(glb, expectedResult);
  -    // Check that the result is a lower bound.
  -    expect(typeSystem.isSubtypeOf(glb, type1), true);
  -    expect(typeSystem.isSubtypeOf(glb, type2), true);
  -    // Check for symmetry while we're at it.  Unfortunately,
  -    // for function types, the current version of equality
  -    // does not respect re-ordering of named parameters, so
  -    // for function types we just check if they are mutual subtypes.
  -    // https://github.com/dart-lang/sdk/issues/26126
  -    // TODO(leafp): Fix this.
  -    glb = typeSystem.getGreatestLowerBound(type2, type1);
  -    if (glb is FunctionTypeImpl) {
  -      expect(typeSystem.isSubtypeOf(glb, expectedResult), true);
  -      expect(typeSystem.isSubtypeOf(expectedResult, glb), true);
  -    } else {
  -      expect(glb, expectedResult);
  -    }
  -  }
  -
  -  void _checkLeastUpperBound(
  -      DartType type1, DartType type2, DartType expectedResult) {
  -    DartType lub = typeSystem.getLeastUpperBound(type1, type2);
  -    expect(lub, expectedResult);
  -    // Check that the result is an upper bound.
  -    expect(typeSystem.isSubtypeOf(type1, lub), true);
  -    expect(typeSystem.isSubtypeOf(type2, lub), true);
  -
  -    // Check for symmetry while we're at it.  Unfortunately,
  -    // for function types, the current version of equality
  -    // does not respect re-ordering of named parameters, so
  -    // for function types we just check if they are mutual subtypes.
  -    // https://github.com/dart-lang/sdk/issues/26126
  -    // TODO(leafp): Fix this.
  -    lub = typeSystem.getLeastUpperBound(type2, type1);
  -    if (lub is FunctionTypeImpl) {
  -      expect(typeSystem.isSubtypeOf(lub, expectedResult), true);
  -      expect(typeSystem.isSubtypeOf(expectedResult, lub), true);
  -    } else {
  -      expect(lub, expectedResult);
  -    }
  +
  +  ClassElementImpl _class({
  +    @required String name,
  +    bool isAbstract = false,
  +    InterfaceType superType,
  +    List<TypeParameterElement> typeParameters = const [],
  +    List<InterfaceType> interfaces = const [],
  +  }) {
  +    var element = ClassElementImpl(name, 0);
  +    element.typeParameters = typeParameters;
  +    element.supertype = superType ?? objectType;
  +    element.interfaces = interfaces;
  +    return element;
     }
   
     /**
  
positive.code:     ]);
  
      // Create a non-identical but equal copy of Function, and verify subtyping
      var copyOfFunction = new InterfaceTypeImpl(functionType.element);
      _checkEquivalent(functionType, copyOfFunction);
    }
  
    void test_genericFunction_generic_monomorphic() {
      DartType s = TypeBuilder.variable("S");
      DartType t = TypeBuilder.variable("T", bound: s);
      DartType u = TypeBuilder.variable("U", bound: intType);
      DartType v = TypeBuilder.variable("V", bound: u);
  
      DartType a = TypeBuilder.variable("A");
      DartType b = TypeBuilder.variable("B", bound: a);
      DartType c = TypeBuilder.variable("C", bound: intType);
      DartType d = TypeBuilder.variable("D", bound: c);
  
      _checkIsStrictSubtypeOf(
          TypeBuilder.function(types: [s, t], required: [s], result: t),
          TypeBuilder.function(
              types: [a, b], required: [bottomType], result: dynamicType));
  
      _checkIsNotSubtypeOf(
          TypeBuilder.function(types: [u, v], required: [u], result: v),
          TypeBuilder.function(
              types: [c, d], required: [objectType], result: objectType));
  
      _checkIsNotSubtypeOf(
          TypeBuilder.function(types: [u, v], required: [u], result: v),
          TypeBuilder.function(
              types: [c, d], required: [intType], result: intType));
    }
  
    void test_genericFunction_genericDoesNotSubtypeNonGeneric() {
      DartType s = TypeBuilder.variable("S");
      DartType t = TypeBuilder.variable("T", bound: s);
      DartType u = TypeBuilder.variable("U", bound: intType);
      DartType v = TypeBuilder.variable("V", bound: u);
  
      _checkIsNotSubtypeOf(
          TypeBuilder.function(types: [s, t], required: [s], result: t),
          TypeBuilder.function(required: [dynamicType], result: dynamicType));
  
      _checkIsNotSubtypeOf(
          TypeBuilder.function(types: [u, v], required: [u], result: v),
          TypeBuilder.function(required: [objectType], result: objectType));
  
      _checkIsNotSubtypeOf(
          TypeBuilder.function(types: [u, v], required: [u], result: v),
          TypeBuilder.function(required: [intType], result: intType));
    }
  
    void test_genericFunction_simple() {
      DartType s = TypeBuilder.variable("S");
      DartType t = TypeBuilder.variable("T");
  
      _checkEquivalent(
          TypeBuilder.function(types: [t]), TypeBuilder.function(types: [s]));
  
      _checkEquivalent(TypeBuilder.function(types: [t], required: [t], result: t),
          TypeBuilder.function(types: [s], required: [s], result: s));
    }
  
    void test_genericFunction_simple_bounded() {
      DartType s = TypeBuilder.variable("S");
      DartType t = TypeBuilder.variable("T", bound: s);
      DartType u = TypeBuilder.variable("U");
      DartType v = TypeBuilder.variable("V", bound: u);
  
      _checkEquivalent(TypeBuilder.function(types: [s, t]),
          TypeBuilder.function(types: [u, v]));
  
      _checkEquivalent(
          TypeBuilder.function(types: [s, t], required: [s], result: t),
          TypeBuilder.function(types: [u, v], required: [u], result: v));
  
      {
        DartType top =
            TypeBuilder.function(types: [s, t], required: [t], result: s);
        DartType left =
            TypeBuilder.function(types: [u, v], required: [u], result: u);
        DartType right =
            TypeBuilder.function(types: [u, v], required: [v], result: v);
        DartType bottom =
            TypeBuilder.function(types: [s, t], required: [s], result: t);
        _checkLattice(top, left, right, bottom);
      }
    }
  
    void test_generics() {
      ClassElementImpl LClass = ElementFactory.classElement2('L', ["T"]);
      InterfaceType LType = LClass.type;
      ClassElementImpl MClass = ElementFactory.classElement2('M', ["T"]);
      DartType typeParam = MClass.typeParameters[0].type;
      InterfaceType superType = LType.instantiate(<DartType>[typeParam]);
      MClass.interfaces = <InterfaceType>[superType];
      InterfaceType MType = MClass.type;
  
      InterfaceType top = LType.instantiate(<DartType>[dynamicType]);
      InterfaceType left = MType.instantiate(<DartType>[dynamicType]);
      InterfaceType right = LType.instantiate(<DartType>[intType]);
      InterfaceType bottom = MType.instantiate(<DartType>[intType]);
  
      _checkLattice(top, left, right, bottom);
    }
  
negative.code:   }
  
    void test_dynamic_function() {
      _checkLeastUpperBound(dynamicType, _functionType(), dynamicType);
    }
  
    void test_dynamic_interface() {
      var interfaceType = _class(name: 'A').type;
      _checkLeastUpperBound(dynamicType, interfaceType, dynamicType);
    }
  
    void test_dynamic_typeParam() {
      var typeParam = _typeParameter('T').type;
      _checkLeastUpperBound(dynamicType, typeParam, dynamicType);
    }
  
  