anchor.diff:  
   format_hfields(Indent, Fields, CompileOpts, Defs) ->
       TypeSpecs = get_type_specs_by_opts(CompileOpts),
  +    MapsOrRecords = get_records_or_maps_by_opts(CompileOpts),
  +    TypeSpecifierSep = case MapsOrRecords of
  +                           records -> "::";
  +                           maps -> "=>"
  +                       end,
       string:join(
         lists:map(
           fun({I, #?gpb_field{name=Name, fnum=FNum, opts=FOpts,
                               occurrence=Occur}=Field}) ->
                   DefaultStr = case proplists:get_value(default, FOpts, '$no') of
  -                                 '$no'   -> case Occur of
  -                                                repeated -> ?f(" = []");
  +                                 '$no'   -> case {Occur, MapsOrRecords} of
  +                                                {repeated, records} -> ?f(" = []");
                                                   _        -> ""
                                               end;
                                    Default -> ?f(" = ~p", [Default])
  
positive.code:   string_to_typestr(get_strings_as_binaries_by_opts(Opts));
  type_to_typestr_2(bytes, _Defs, _Opts)    -> "binary()";
  type_to_typestr_2({enum,E}, Defs, _Opts)  -> enum_typestr(E, Defs);
  type_to_typestr_2({msg,M}, _DEfs, _Opts)  -> ?f("#~p{}", [M]).
  
  % when the strings_as_binaries option is requested the corresponding
  % typespec should be spec'ed
  
negative.code:   ?f("-type '~s'() :: ~s.", [Enum,
      string:join(["'"++atom_to_list(EName)++"'" || {EName, _} <- Enumeration], " | ")]).
  
  format_record_typespec(records, Msg, _Fields, _Defs) ->
    ?f("-type '~s'() :: #~s{}.", [Msg, Msg]);
  format_record_typespec(maps, Msg, Fields, Defs) ->
    ?f("-type '~s'() :: ~n"
       "      #{~s~n"
       "       }.",
        [Msg, outdent_first(format_hfields(7 + 1, Fields,
                                           [{maps, true}, {type_specs, true}], Defs))]).
  
  format_export_types(false, _, _Defs) -> "";
  format_export_types(true, MapsOrRecords, Defs) ->
    iolist_to_binary(
      ["%% enumerate types\n",
       string:join([format_enum_typespec(Enum, Enumeration)
                      || {{enum, Enum}, Enumeration} <- Defs],
                  "\n"),
      "\n",
       ?f("-export_type([~s]).",
          [string:join(["'"++atom_to_list(Enum)++"'/0"
                      || {{enum, Enum}, _} <- Defs], ", ")]),
      "\n\n",
      "%% message types\n",
      string:join([format_record_typespec(MapsOrRecords, Msg, Fields, Defs)
                      || {{msg, Msg}, Fields} <- Defs],
                  "\n"),
      "\n",
       ?f("-export_type([~s]).",
          [string:join(["'"++atom_to_list(Msg)++"'/0"
                      || {{msg, Msg}, _} <- Defs], ", ")]),
       "\n"]).
  
  %% -- hrl -----------------------------------------------------
  