anchor.diff:             match case with
               | null -> identity
               | case -> case)
  -      {new CloneSmart<'t> () with
  +      {new CloneSmarter<'t> () with
           override this.Clone (original) =
             // First we extract the case index.
             let caseIndex = union.Tag original
  
positive.code:       null
      else
        let identity =
          {new CloneSmart<'t> () with 
            override this.Clone (original) = original}
        let cloneUnion =
          Array.ofList cloneUnion
  
negative.code: /// Type of cloning functions.
  type Clone<'x> = 'x -> 'x
  
  /// A smart cloning function.
  type [<AllowNullLiteral; AbstractClass>] CloneSmarter<'x> () =
    abstract Clone: 'x -> 'x
  
  /// Type of an intermediate step in cloning a product type.
  type [<AllowNullLiteral; AbstractClass>] CloneProduct<'e, 'es, 't> () =
    abstract Clone: byref<'e> -> unit
    abstract ForAll: (obj -> bool) -> bool
  
  /// Type of a partial union cloning function (or list of such functions).
  type CloneUnion<'c, 'cs, 't> = CloneUnion of list<CloneSmarter<'t>>
  
  ////////////////////////////////////////////////////////////////////////////////
   
  /// A helper function for products (including individual union cases).
  let CloneProductToCloneSmart (isMutable: bool)
                               (asProduct: AsProduct<'es, 't>)
                               (cloneProduct': CloneProduct<'es, 'es, 't>) : CloneSmarter<'t> =
    match cloneProduct' with
     | null ->
       null
     | cloneProduct ->
       if not isMutable &&
          cloneProduct.ForAll (function :? CloneSmarter<'t> -> true | _ -> false) then
         null
       else
         {new CloneSmarter<'t> () with
           override this.Clone (original) =
            // First we allocate space for elements of the clone from stack.
            let mutable elems = Unchecked.defaultof<'es>
            // We then extract the original elements of the product.
            asProduct.Extract (original, &elems)
            // Then we clone the elements in-place.
            cloneProduct.Clone (&elems)
            // Then we create a clone from the cloned elements.
            asProduct.Create (&elems)}
  
  ////////////////////////////////////////////////////////////////////////////////
  
  