anchor.diff:          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 t = getType toAsm m.DeclaringType (replaceType asmMappings)
                   let parameterTypes = 
                       m.GetParameters() 
                       |> Seq.map (fun p -> replaceType asmMappings p.ParameterType) 
  
positive.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.FullName
              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
  
negative.code:         | Some toAsm -> f toAsm
          | None -> lazyOriginal.Value
  
      let private getType (asm:Assembly) (t:Type) rt =
          let getFullName (t:Type) =
              let fullName = t.FullName        
              if fullName.StartsWith("FSI_")
              then fullName.Substring(fullName.IndexOf('.') + 1)
              else fullName
          let newT =
              if t.IsGenericType && not t.IsGenericTypeDefinition then 
                  let genericType = t.GetGenericTypeDefinition()
                  let newT = asm.GetType (getFullName genericType)
                  if newT = null then 
                      null
                  else
                      let typeArguments = 
                          t.GetGenericArguments()
                          |> Seq.map rt
                          |> Seq.toArray
                      newT.MakeGenericType(typeArguments)
              else 
                  asm.GetType (getFullName t)
          if newT = null then
              failwithf "Type '%O' not found in '%s'" t asm.Location
          newT
  
      let rec private replaceType asmMappings (t : Type) =        
          if t.GetType().Name = "ProvidedSymbolType" then t
          elif t.GetType() = typeof<ProvidedTypeDefinition> then t
          else replace asmMappings (t, t.Assembly) (fun toAsm -> getType toAsm t (replaceType asmMappings))
  
      let private replaceProperty asmMappings (p : PropertyInfo) =
          if p.GetType() = typeof<ProvidedProperty> then p
          else replace asmMappings (p, p.DeclaringType.Assembly) (fun toAsm ->
              let t = getType toAsm p.DeclaringType (replaceType asmMappings)
              let isStatic = 
                  p.CanRead && p.GetGetMethod().IsStatic || 
                  p.CanWrite && p.GetSetMethod().IsStatic
  