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:         | Some toAsm -> f toAsm
          | None -> lazyOriginal.Value
  
      let private getType (asm:Assembly) (fullName:string) =
          let fullName = 
              if fullName.StartsWith("FSI_")
              then fullName.Substring(fullName.IndexOf('.') + 1)
              else fullName
          let t = asm.GetType fullName
          if t = null then
              failwithf "Type '%O' not found in '%s'" t asm.Location
          t
  
      let 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.FullName)
  
      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.FullName
              let isStatic = 
                  p.CanRead && p.GetGetMethod().IsStatic || 
                  p.CanWrite && p.GetSetMethod().IsStatic
  
negative.code:         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 (replaceType asmMappings), v.IsMutable)
                  // store the asmMappings as we'll have to revert them later
                  varTable.Add(newVar, v)
                  newVar
  