anchor.diff:              failwithf "Type '%O' not found in '%s'" t asm.Location
           newT
   
  +    let rec getAssemblies (t:Type) = [
  +        yield t.Assembly
  +        if t.IsGenericType && not t.IsGenericTypeDefinition then
  +            for t in t.GetGenericArguments() do
  +                yield! getAssemblies t
  +    ]
  +
       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))
  +        else replace asmMappings (t, getAssemblies t) (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 ->
  +        else replace asmMappings (p, getAssemblies p.DeclaringType) (fun toAsm ->
               let t = getType toAsm p.DeclaringType (replaceType asmMappings)
               let isStatic = 
                   p.CanRead && p.GetGetMethod().IsStatic || 
  
positive.code:     open Microsoft.FSharp.Quotations.Patterns
      open Microsoft.FSharp.Reflection
  
      let private replace (asmMappings : (Assembly * Assembly) list) (original, originalAsm) f =
          let toAsm = 
              asmMappings
              |> Seq.tryPick (fun (fromAsm, toAsm) -> if originalAsm = fromAsm then Some toAsm else None)
          match toAsm with
          | Some toAsm -> f toAsm
          | None -> original
  
negative.code: 
      let private replaceVar asmMappings (varTable: IDictionary<_,_>) reversePass (v: Var) =
          if v.Type.GetType() = typeof<ProvidedTypeDefinition> then v
          else replace asmMappings (v, getAssemblies v.Type) (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
  