anchor.diff:              System.Activator.CreateInstance(t, tEls)
           | _ -> raise DecoderException
   
  -[<MethodImpl(MethodImplOptions.NoInlining)>]
  -let unmakeSet<'T when 'T : comparison> (dV: obj -> Encoded) =
  -    let dV x = dV x // Force the method to return an FSharpFunc instead of taking 2 args
  -    fun (x: obj) ->
  -        EncodedArray [for v in unbox<Set<'T>> x -> dV v]
  +let unmakeSet<'T when 'T : comparison> (dV: obj -> Encoded) (x: obj) =
  +    EncodedArray [for v in unbox<Set<'T>> x -> dV v]
   
   let setEncoder dE (i: FormatSettings) (t: System.Type) =
       let tg = t.GetGenericArguments()
       if tg.Length <> 1 then raise EncoderException
       if i.FlattenCollections then
  -        callGeneric unmakeSet "unmakeSet" tg.[0] dE
  +        callGeneric <@ unmakeSet @> dE tg.[0]
       else
       let dI = dE tg.[0]
       let treeF = t.GetFields(fieldFlags) |> Array.find (fun f -> f.Name.StartsWith "tree")
  
positive.code:         .MakeGenericMethod(t.GetGenericArguments())
          .Invoke(null, [||])
  
  let callGeneric (actualFunction: 'f -> 'g) (name: string) (targ: System.Type) (dD: System.Type -> 'f) =
      // actualFunction is not used but it must be passed
      // to check the types and avoid being dead-code-eliminated.
      FastInvoke.Compile(
          thisModule.GetMethod(name,
              flags ||| System.Reflection.BindingFlags.Static
          ).MakeGenericMethod(targ)
      ).Invoke1(dD targ)
      :?> 'g
  
  [<MethodImpl(MethodImplOptions.NoInlining)>]
  let unmakeList<'T> (dV: obj -> Encoded) =
      let dV x = dV x // Force the method to return an FSharpFunc instead of taking 2 args
      fun (x: obj) ->
          EncodedArray [
              for v in unbox<list<'T>> x ->
                  dV (box v)
          ]
  
  let unionEncoder dE (i: FormatSettings) (t: System.Type) =
      if i.FlattenCollections &&
          t.IsGenericType &&
          t.GetGenericTypeDefinition() = typedefof<list<_>>
      then
          let tI = t.GetGenericArguments().[0]
          callGeneric unmakeList "unmakeList" tI dE
      else
      let tR = FSV.PreComputeUnionTagReader(t, flags)
      let cs =
  
negative.code:         t.IsGenericType &&
          t.GetGenericTypeDefinition() = typedefof<list<_>>
      then
          t.GetGenericArguments().[0]
          |> callGeneric <@ makeList @> dD
      else
      let cs =
          FST.GetUnionCases(t, flags)
  