anchor.diff:    void handleReturn(TypeInferrerImpl inferrer, DartType type,
         Expression expression, int fileOffset) {
       if (isGenerator) return;
  +    _updateInferredReturnType(
  +        inferrer, type, expression, fileOffset, true, false);
  +  }
  +
  +  void handleYield(TypeInferrerImpl inferrer, bool isYieldStar, DartType type,
  +      Expression expression, int fileOffset) {
  +    if (!isGenerator) return;
  +    _updateInferredReturnType(
  +        inferrer, type, expression, fileOffset, false, isYieldStar);
  +  }
  +
  +  DartType inferReturnType(TypeInferrerImpl inferrer) {
  +    assert(_needToInferReturnType);
  +    DartType inferredReturnType = _wrapAsyncOrGenerator(
  +        inferrer, inferrer.inferReturnType(_inferredReturnType));
  +    if (returnContext != null &&
  +        !_analyzerSubtypeOf(inferrer, inferredReturnType, returnContext)) {
  +      // If the inferred return type isn't a subtype of the context, we use the
  +      // context.
  +      return greatestClosure(inferrer.coreTypes, returnContext);
  +    }
  +
  +    return inferredReturnType;
  +  }
  +
  +  void _updateInferredReturnType(TypeInferrerImpl inferrer, DartType type,
  +      Expression expression, int fileOffset, bool isReturn, bool isYieldStar) {
  +    if (_needImplicitDowncasts) {
  +      var expectedType = isYieldStar
  +          ? _wrapAsyncOrGenerator(inferrer, returnContext)
  +          : returnContext;
  +      if (expectedType != null) {
  +        expectedType = greatestClosure(inferrer.coreTypes, expectedType);
  +        if (inferrer.checkAssignability(
  +                expectedType, type, expression, fileOffset) !=
  +            null) {
  +          type = expectedType;
  +        }
  +      }
  +    }
       var unwrappedType = type;
  -    if (isAsync) {
  +    if (isAsync && isReturn) {
         if (type is InterfaceType) {
           if (identical(type.classNode, inferrer.coreTypes.futureClass)) {
             unwrappedType = type.typeArguments[0];
  
positive.code:           unwrappedType = type.typeArguments[0];
          }
        }
      }
      _updateInferredReturnType(
          inferrer, type, unwrappedType, expression, fileOffset, false);
    }
  
    void handleYield(TypeInferrerImpl inferrer, bool isYieldStar, DartType type,
        Expression expression, int fileOffset) {
      if (!isGenerator) return;
      var unwrappedType = type;
      if (isYieldStar) {
        unwrappedType = inferrer.getDerivedTypeArgumentOf(
                type,
                isAsync
  
negative.code:                   : inferrer.coreTypes.iterableClass) ??
            type;
      }
      if (_needToInferReturnType) {
        if (_inferredReturnType == null) {
          _inferredReturnType = unwrappedType;
        } else {
          _inferredReturnType = inferrer.typeSchemaEnvironment
              .getLeastUpperBound(_inferredReturnType, unwrappedType);
        }
      }
    }
  