anchor.diff:          if v.Type.GetType() = typeof<ProvidedTypeDefinition> then v
           else replace asmMappings (v, v.Type.Assembly) (fun toAsm ->
               if reversePass then
  -                let newVar = Var (v.Name, getType toAsm v.Type.FullName, v.IsMutable)
  +                let newVar = Var (v.Name, getType toAsm v.Type (replaceType asmMappings), v.IsMutable)
                   // store the asmMappings as we'll have to revert them later
                   varTable.Add(newVar, v)
                   newVar
  
positive.code:         if m.GetType() = typeof<ProvidedMethod> then m
          elif m.DeclaringType.FullName = "Microsoft.FSharp.Core.LanguagePrimitives+IntrinsicFunctions" then m // these methods don't really exist, so there's no need to replace them
          else replace asmMappings (m, m.DeclaringType.Assembly) (fun toAsm ->
                  let t = getType toAsm m.DeclaringType.FullName            
                  let parameterTypes = 
                      m.GetParameters() 
                      |> Seq.map (fun p -> replaceType asmMappings p.ParameterType) 
  
negative.code: 
      let private replaceUnionCase asmMappings (uci : UnionCaseInfo) exprs =
          replaceLazy asmMappings (lazy (Expr.NewUnionCase (uci, exprs)), uci.DeclaringType.Assembly) (fun toAsm ->
              let t = getType toAsm uci.DeclaringType (replaceType asmMappings)
              let constructorMethod = t.GetMethod(uci.Name)
              if constructorMethod = null then
                  failwithf "Method '%s' of type '%O' not found in '%s'" uci.Name t toAsm.Location
  