anchor.diff:  // Run the constraint solver with undo (used during method overload resolution)
   
   type Trace = 
  -    { mutable actions: (unit -> unit) list  }
  +    { mutable actions:  ((unit -> unit) * (unit -> unit)) list }
       static member New () =  { actions = [] }
  -    member t.Undo () = List.iter (fun a -> a ()) t.actions
  -    member t.Push f = t.actions <- f :: t.actions
  +    member t.Undo () = List.iter (fun (_, a) -> a ()) t.actions
  +    member t.Push f undo = t.actions <- (f, undo) :: t.actions
   
   type OptionalTrace = 
       | NoTrace
       | WithTrace of Trace
       member x.HasTrace = match x with NoTrace -> false | WithTrace _ -> true
  -
  +    member t.Exec f undo = 
  +        match t with        
  +        | WithTrace trace -> trace.Push f undo; f()
  +        | NoTrace -> f()
  +    member t.AddFromReplay source =
  +        source.actions |> List.rev |>
  +            match t with        
  +            | WithTrace trace -> List.iter (fun (action, undo) -> trace.Push action undo; action())
  +            | NoTrace         -> List.iter (fun (action, _   ) -> action())
   
   let CollectThenUndo f = 
       let trace = Trace.New()
  
positive.code:             SolveTypStaticReqTypar csenv trace req tpr
            else CompleteD
        
  let rec TransactDynamicReq trace (tpr:Typar) req = 
      let orig = tpr.DynamicReq
      match trace with 
      | NoTrace -> () 
      | WithTrace trace -> trace.Push (fun () -> tpr.SetDynamicReq orig) 
      tpr.SetDynamicReq req;
      CompleteD
  
  and SolveTypDynamicReq (csenv:ConstraintSolverEnv) trace req ty =
  
negative.code:                                  (TypesMustSubsumeOrConvertInsideUndo csenv ndeep trace cxsln m)// REVIEW: this should not be an "InsideUndo" operation
                                   (ArgsMustSubsumeOrConvert csenv ndeep trace cxsln cx.IsSome) 
                                   reqdRetTyOpt 
                                   calledMeth
                          | WithTrace calledMethTrc ->
  
                              // Re-play existing trace
                              trace.AddFromReplay calledMethTrc
  
                              // Unify return type
                              match reqdRetTyOpt with 
                              | None -> CompleteD 
                              | Some _  when calledMeth.Method.IsConstructor -> CompleteD 
                              | Some reqdRetTy ->
                                  let methodRetTy = 
                                      if List.isEmpty calledMeth.UnnamedCalledOutArgs then 
                                          calledMeth.ReturnType 
                                      else 
                                          let outArgTys = calledMeth.UnnamedCalledOutArgs |> List.map (fun calledArg -> destByrefTy g calledArg.CalledArgumentType) 
                                          if isUnitTy g calledMeth.ReturnType then mkRefTupledTy g outArgTys
                                          else mkRefTupledTy g (calledMeth.ReturnType :: outArgTys)
                                  MustUnify csenv ndeep trace cxsln reqdRetTy methodRetTy)
  
      | None -> 
          None, errors        
  