anchor.diff:                  // Check the second part is a simple return
                   match convertSimpleReturnToExpr varSpace innerComp2 with
                   | None -> None
  -                | Some innerExpr2 -> Some (SynExpr.Sequential (sp, true, innerComp1, innerExpr2, m))
  +                | Some (innerExpr2, optionalCont) -> Some (SynExpr.Sequential (sp, true, innerComp1, innerExpr2, m), optionalCont)
               else
                   None
   
  
positive.code:                 let isYield = not (customOperationMaintainsVarSpaceUsingBind nm)
                  translatedCtxt (transNoQueryOps (SynExpr.YieldOrReturn ((isYield, false), varSpaceExpr, mClause)))
              
              let rec consumeClauses (varSpace: LazyWithContext<_, _>) dataCompPrior compClausesExpr lastUsesBind =
  
                  // Substitute 'yield <var-space>' into the context
  
                  let patvs, _env = varSpace.Force comp.Range
                  let varSpaceSimplePat = mkSimplePatForVarSpace mClause patvs
                  let varSpacePat = mkPatForVarSpace mClause patvs
  
                  match compClausesExpr with 
                  
                  // Detect one custom operation... This clause will always match at least once...
                  | OptionalSequential (CustomOperationClause (nm, (opName, _maintainsVarSpaceUsingBind, _maintainsVarSpace, _allowInto, isLikeZip, isLikeJoin, isLikeGroupJoin, _, methInfo), opExpr, mClause, optionalIntoPat), optionalCont) ->
  
                      // Record the resolution of the custom operation for posterity
                      let item = Item.CustomOperation (opName, (fun () -> customOpUsageText nm), Some methInfo)
  
                      // FUTURE: consider whether we can do better than emptyTyparInst here, in order to display instantiations
                      // of type variables in the quick info provided in the IDE.
                      CallNameResolutionSink cenv.tcSink (nm.idRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Use, env.eAccessRights)
  
                      if isLikeZip || isLikeJoin || isLikeGroupJoin then
                          errorR(Error(FSComp.SR.tcBinaryOperatorRequiresBody(nm.idText, Option.get (customOpUsageText nm)), nm.idRange))
                          match optionalCont with 
                          | None -> 
                              // we are about to drop the 'opExpr' AST on the floor. we've already reported an error. attempt to get name resolutions before dropping it
                              RecordNameAndTypeResolutions_IdeallyWithoutHavingOtherEffects cenv env tpenv opExpr
                              dataCompPrior
                          | Some contExpr -> consumeClauses varSpace dataCompPrior contExpr lastUsesBind 
                      else
  
                          let maintainsVarSpace = customOperationMaintainsVarSpace nm
                          let maintainsVarSpaceUsingBind = customOperationMaintainsVarSpaceUsingBind nm
  
                          let expectedArgCount = expectedArgCountForCustomOperator nm 
  
                          let dataCompAfterOp = 
                              match opExpr with 
                              | StripApps(SingleIdent nm, args) -> 
                                  if args.Length = expectedArgCount then 
                                      // Check for the [<ProjectionParameter>] attribute on each argument position
                                      let args = args |> List.mapi (fun i arg -> 
                                          if isCustomOperationProjectionParameter (i+1) nm then 
                                              SynExpr.Lambda (false, false, varSpaceSimplePat, arg, arg.Range.MakeSynthetic())
                                          else arg)
                                      mkSynCall methInfo.DisplayName mClause (dataCompPrior :: args)
                                  else 
                                      errorR(Error(FSComp.SR.tcCustomOperationHasIncorrectArgCount(nm.idText, expectedArgCount, args.Length), nm.idRange))
                                      mkSynCall methInfo.DisplayName mClause ([ dataCompPrior ] @ List.init expectedArgCount (fun i -> arbExpr("_arg" + string i, mClause))) 
                              | _ -> failwith "unreachable"
  
                          match optionalCont with 
                          | None -> 
                              match optionalIntoPat with 
                              | Some intoPat -> errorR(Error(FSComp.SR.tcIntoNeedsRestOfQuery(), intoPat.Range))
                              | None -> ()
                              dataCompAfterOp
  
                          | Some contExpr -> 
  
                                  // select a.Name into name; ...
                                  // distinct into d; ...
                                  //
                                  // Rebind the into pattern and process the rest of the clauses
                                  match optionalIntoPat with 
                                  | Some intoPat -> 
                                      if not (customOperationAllowsInto nm) then 
                                          error(Error(FSComp.SR.tcOperatorDoesntAcceptInto(nm.idText), intoPat.Range))
  
                                      // Rebind using either for ... or let!....
                                      let rebind = 
                                          if maintainsVarSpaceUsingBind then 
                                              SynExpr.LetOrUseBang (NoSequencePointAtLetBinding, false, false, intoPat, dataCompAfterOp, [], contExpr, intoPat.Range) 
                                          else 
                                              SynExpr.ForEach (NoSequencePointAtForLoop, SeqExprOnly false, false, intoPat, dataCompAfterOp, contExpr, intoPat.Range)
  
                                      trans true q emptyVarSpace rebind id
  
                                  // select a.Name; ...
                                  // distinct; ...
                                  //
                                  // Process the rest of the clauses
                                  | None -> 
                                      if maintainsVarSpace || maintainsVarSpaceUsingBind then
                                          consumeClauses varSpace dataCompAfterOp contExpr maintainsVarSpaceUsingBind
                                      else
                                          consumeClauses emptyVarSpace dataCompAfterOp contExpr false 
  
                  // No more custom operator clauses in compClausesExpr, but there may be clauses like join, yield etc. 
                  // Bind/iterate the dataCompPrior and use compClausesExpr as the body.
                  | _ -> 
                      // Rebind using either for ... or let!....
                      let rebind = 
                          if lastUsesBind then 
                              SynExpr.LetOrUseBang (NoSequencePointAtLetBinding, false, false, varSpacePat, dataCompPrior, [], compClausesExpr, compClausesExpr.Range) 
                          else 
                              SynExpr.ForEach (NoSequencePointAtForLoop, SeqExprOnly false, false, varSpacePat, dataCompPrior, compClausesExpr, compClausesExpr.Range)
                      
                      trans true q varSpace rebind id
  
              // Now run the consumeClauses
              Some (consumeClauses varSpace dataCompPriorToOp comp false)
  
          | SynExpr.Sequential (sp, true, innerComp1, innerComp2, m) -> 
  
  
negative.code: 
      and convertSimpleReturnToExpr varSpace innerComp =
          match innerComp with 
          | SynExpr.YieldOrReturn ((false, _), returnExpr, _) -> Some (returnExpr, None)
          | SynExpr.Match (spMatch, expr, clauses, m) ->
              let clauses = 
                  clauses |> List.map (fun (Clause(pat, cond, innerComp2, patm, sp)) -> 
                      match convertSimpleReturnToExpr varSpace innerComp2 with
                      | None -> None // failure
                      | Some (_, Some _) -> None // custom op on branch = failure
                      | Some (innerExpr2, None) -> Some (Clause(pat, cond, innerExpr2, patm, sp)))
              if clauses |> List.forall Option.isSome then
                  Some (SynExpr.Match (spMatch, expr, (clauses |> List.map Option.get), m), None)
              else
                  None
  
          | SynExpr.IfThenElse (guardExpr, thenComp, elseCompOpt, spIfToThen, isRecovery, mIfToThen, mIfToEndOfElseBranch) ->
              match convertSimpleReturnToExpr varSpace thenComp with
              | None -> None
              | Some (_, Some _) -> None
              | Some (thenExpr, None) ->
              let elseExprOptOpt  = 
                  match elseCompOpt with 
                  | None -> Some None 
                  | Some elseComp -> 
                      match convertSimpleReturnToExpr varSpace elseComp with
                      | None -> None // failure
                      | Some (_, Some _) -> None // custom op on branch = failure
                      | Some (elseExpr, None) -> Some (Some elseExpr)
              match elseExprOptOpt with 
              | None -> None
              | Some elseExprOpt -> Some (SynExpr.IfThenElse (guardExpr, thenExpr, elseExprOpt, spIfToThen, isRecovery, mIfToThen, mIfToEndOfElseBranch), None)
  
          | SynExpr.LetOrUse (isRec, false, binds, innerComp, m) ->
              match convertSimpleReturnToExpr varSpace innerComp with
              | None -> None
              | Some (_, Some _) -> None 
              | Some (innerExpr, None) -> Some (SynExpr.LetOrUse (isRec, false, binds, innerExpr, m), None)
  
          | OptionalSequential (CustomOperationClause (nm, _, _, mClause, _), _) when customOperationMaintainsVarSpaceUsingBind nm -> 
  
              let patvs, _env = varSpace.Force comp.Range
              let varSpaceExpr = mkExprForVarSpace mClause patvs
              
              Some (varSpaceExpr, Some (innerComp, mClause))
  
          | SynExpr.Sequential (sp, true, innerComp1, innerComp2, m) -> 
  
  