anchor.diff:                    end,
                     [replace_tree('<F>', FVar),
                      replace_tree('<Bin>', PrevBVar),
  -                   OneofClauseTransform]);
  +                   repeat_clauses('<oneof...>', OneofClauseTransforms)]);
           {maps, omitted} ->
  -            ?expr(case maps:find('fieldname', 'M') of
  -                      error        -> '<Bin>';
  -                      '<oneof...>' -> '<expr>'
  +            ?expr(case 'M' of
  +                      '<oneof...>' -> '<expr>';
  +                      _ -> '<Bin>'
                     end,
                     [replace_term('fieldname', FName),
                      replace_tree('M', MsgVar),
                      replace_tree('<Bin>', PrevBVar),
  -                   OneofClauseTransform])
  +                   repeat_clauses('<oneof...>', OneofClauseTransforms)])
       end.
   
   mk_field_encode_fn_name(MsgName, #?gpb_field{occurrence=repeated, name=FName})->
  
positive.code:                        Transforms);
                  {maps, omitted} ->
                      ?expr(
                         case maps:find('fieldname', 'M') of
                             error ->
                                 '<Bin>';
                             {ok, '<F>'} ->
                                 '<enc>'('<F>', <<'<Bin>'/binary, '<Key>'>>)
                         end,
                         [replace_tree('M', MsgVar) | Transforms])
              end;
          repeated ->
              ?expr(
  
negative.code:                '<enc>'('<F>', <<'<Bin>'/binary, '<Key>'>>),
                 Transforms)
      end;
  field_encode_expr(MsgName, MsgVar, #gpb_oneof{name=FName, fields=OFields},
                    FVar, PrevBVar, AnRes, Opts) ->
      OFVar = prefix_var("O", FVar),
      OneofClauseTransforms =
          [begin
               OFVal = ?expr({'<oneof-name>', '<OF>'},
                             [replace_term('<oneof-name>', Name),
                              replace_tree('<OF>', OFVar)]),
               MatchPattern =
                   case get_mapping_and_unset_by_opts(Opts) of
                       X when X == records;
                              X == {maps, present_undefined} ->
                           OFVal;
                       {maps, omitted} ->
                           map_match([{FName, OFVal}])
                   end,
               %% undefined is already handled, we have a match,
               %% the field occurs, as if it had been required
               OField2 = OField#?gpb_field{occurrence=required},
               EncExpr = field_encode_expr(MsgName, MsgVar, OField2, OFVar,
                                           PrevBVar, AnRes, Opts),
               [replace_tree('<oneof...>', MatchPattern),
                replace_tree('<expr>', EncExpr)]
             end
             || #?gpb_field{name=Name}=OField <- OFields],
      case get_mapping_and_unset_by_opts(Opts) of
          X when X == records;
                 X == {maps, present_undefined} ->
  