anchor.diff:        : lowerBound = lower ?? UnknownInferredType.instance,
           upperBound = upper ?? UnknownInferredType.instance;
   }
  -
  -/// A constraint on a type parameter that we're inferring.
  -class _TypeConstraint extends _TypeRange {
  -  /// The type parameter that is constrained by [lowerBound] or [upperBound].
  -  final TypeParameterType typeParameter;
  -
  -  /// Where this constraint comes from, used for error messages.
  -  ///
  -  /// See [toString].
  -  final _TypeConstraintOrigin origin;
  -
  -  _TypeConstraint(this.origin, this.typeParameter,
  -      {DartType upper, DartType lower})
  -      : super(upper: upper, lower: lower);
  -
  -  _TypeConstraint.fromExtends(TypeParameterType type, DartType extendsType)
  -      : this(new _TypeConstraintFromExtendsClause(type, extendsType), type,
  -            upper: extendsType);
  -
  -  bool get isDownwards => origin is! _TypeConstraintFromArgument;
  -
  -  bool isSatisifedBy(TypeSystem ts, DartType type) =>
  -      ts.isSubtypeOf(lowerBound, type) && ts.isSubtypeOf(type, upperBound);
  -
  -  /// Converts this constraint to a message suitable for a type inference error.
  -  @override
  -  String toString() => !identical(upperBound, UnknownInferredType.instance)
  -      ? "'$typeParameter' must extend '$upperBound'"
  -      : "'$lowerBound' must extend '$typeParameter'";
  -}
  -
  -/// The synthetic element for [UnknownInferredType].
  -class UnknownInferredTypeElement extends ElementImpl
  -    implements TypeDefiningElement {
  -  static final UnknownInferredTypeElement instance =
  -      new UnknownInferredTypeElement._();
  -
  -  @override
  -  UnknownInferredType get type => UnknownInferredType.instance;
  -
  -  UnknownInferredTypeElement._() : super(Keyword.DYNAMIC.syntax, -1) {
  -    setModifier(Modifier.SYNTHETIC, true);
  -  }
  -
  -  @override
  -  ElementKind get kind => ElementKind.DYNAMIC;
  -
  -  @override
  -  /*=T*/ accept/*<T>*/(ElementVisitor visitor) => null;
  -}
  -
  -/// A type that is being inferred but is not currently known.
  -///
  -/// This type will only appear in a downward inference context for type
  -/// parameters that we do not know yet. Notationally it is written `?`, for
  -/// example `List<?>`. This is distinct from `List<dynamic>`. These types will
  -/// never appear in the final resolved AST.
  -class UnknownInferredType extends TypeImpl {
  -  static final UnknownInferredType instance = new UnknownInferredType._();
  -
  -  UnknownInferredType._()
  -      : super(UnknownInferredTypeElement.instance, Keyword.DYNAMIC.syntax);
  -
  -  @override
  -  int get hashCode => 1;
  -
  -  @override
  -  bool get isDynamic => true;
  -
  -  @override
  -  bool operator ==(Object object) => identical(object, this);
  -
  -  @override
  -  bool isMoreSpecificThan(DartType type,
  -      [bool withDynamic = false, Set<Element> visitedElements]) {
  -    // T is S
  -    if (identical(this, type)) {
  -      return true;
  -    }
  -    // else
  -    return withDynamic;
  -  }
  -
  -  @override
  -  bool isSubtypeOf(DartType type) => true;
  -
  -  @override
  -  bool isSupertypeOf(DartType type) => true;
  -
  -  @override
  -  TypeImpl pruned(List<FunctionTypeAliasElement> prune) => this;
  -
  -  @override
  -  DartType substitute2(
  -      List<DartType> argumentTypes, List<DartType> parameterTypes,
  -      [List<FunctionTypeAliasElement> prune]) {
  -    int length = parameterTypes.length;
  -    for (int i = 0; i < length; i++) {
  -      if (parameterTypes[i] == this) {
  -        return argumentTypes[i];
  -      }
  -    }
  -    return this;
  -  }
  -
  -  @override
  -  void appendTo(StringBuffer buffer, Set<TypeImpl> types) {
  -    buffer.write('?');
  -  }
  -
  -  /// Given a [type] T, return true if it does not have an unknown type `?`.
  -  static bool isKnown(DartType type) => !isUnknown(type);
  -
  -  /// Given a [type] T, return true if it has an unknown type `?`.
  -  static bool isUnknown(DartType type) {
  -    if (identical(type, UnknownInferredType.instance)) {
  -      return true;
  -    }
  -    if (type is InterfaceTypeImpl) {
  -      return type.typeArguments.any(isUnknown);
  -    }
  -    if (type is FunctionType) {
  -      return isUnknown(type.returnType) ||
  -          type.parameters.any((p) => isUnknown(p.type));
  -    }
  -    return false;
  -  }
  -}
  
positive.code:     return result;
    }
  
    String _formatError(TypeParameterType typeParam, DartType inferred,
        Iterable<_TypeConstraint> constraints) {
      var intro = "Tried to infer '$inferred' for '$typeParam'"
          " which doesn't work:";
  
      var constraintsByOrigin = <_TypeConstraintOrigin, List<_TypeConstraint>>{};
      for (var c in constraints) {
        constraintsByOrigin.putIfAbsent(c.origin, () => []).add(c);
      }
  
      // Only report unique constraint origins.
      Iterable<_TypeConstraint> isSatisified(bool expected) => constraintsByOrigin
          .values
          .where((l) =>
              l.every((c) => c.isSatisifedBy(_typeSystem, inferred)) == expected)
          .expand((i) => i);
  
      String unsatisified = _formatConstraints(isSatisified(false));
      String satisified = _formatConstraints(isSatisified(true));
  
      assert(unsatisified.isNotEmpty);
      if (satisified.isNotEmpty) {
        satisified = "\nThe type '$inferred' was inferred from:\n$satisified";
      }
  
      return '\n\n$intro\n$unsatisified$satisified\n\n'
          'Consider passing explicit type argument(s) to the generic.\n\n';
    }
  
    static String _formatConstraints(Iterable<_TypeConstraint> constraints) {
  
negative.code:   }
  }
  
  class _TypeConstraintFromExtendsClause extends _TypeConstraintOrigin {
    final TypeParameterType typeParam;
    final DartType extendsType;
  
    _TypeConstraintFromExtendsClause(this.typeParam, this.extendsType);
  
    @override
    formatError() {
      return [
        "Type parameter '$typeParam'",
        "declared to extend '$extendsType'."
      ];
    }
  }
  
  class _TypeConstraintFromFunctionContext extends _TypeConstraintOrigin {
    final DartType contextType;
    final DartType functionType;
  
    _TypeConstraintFromFunctionContext(this.functionType, this.contextType);
  
    @override
    formatError() {
      return [
        "Function type",
        "declared as '$functionType'",
        "used where  '$contextType' is required."
      ];
    }
  }
  
  class _TypeConstraintFromReturnType extends _TypeConstraintOrigin {
    final DartType contextType;
    final DartType declaredType;
  