anchor.diff:                                              end;
                                    Default -> ?f(" = ~p", [Default])
                                end,
  -                TypeStr = ?f("~s", [type_to_typestr(Field, Defs)]),
  +                TypeStr = ?f("~s", [type_to_typestr(Field, Defs, CompileOpts)]),
                   CommaSep = if I < length(Fields) -> ",";
                                 true               -> "" %% last entry
                              end,
  
positive.code:     Default = false,
      proplists:get_value(type_specs, Opts, Default).
  
  type_to_typestr(#?gpb_field{type=Type, occurrence=Occurrence}, Defs) ->
      case Occurrence of
          required -> type_to_typestr_2(Type, Defs);
          repeated -> "[" ++ type_to_typestr_2(Type, Defs) ++ "]";
          optional -> type_to_typestr_2(Type, Defs) ++ " | 'undefined'"
      end;
  type_to_typestr(#gpb_oneof{fields=OFields}, Defs) ->
      string:join(
        ["undefined"
         | [?f("{~s, ~s}", [Name, type_to_typestr_2(Type, Defs)])
            || #?gpb_field{name=Name, type=Type} <- OFields]],
        " | ").
  
  type_to_typestr_2(sint32, _Defs)   -> "integer()";
  type_to_typestr_2(sint64, _Defs)   -> "integer()";
  type_to_typestr_2(int32, _Defs)    -> "integer()";
  type_to_typestr_2(int64, _Defs)    -> "integer()";
  type_to_typestr_2(uint32, _Defs)   -> "non_neg_integer()";
  type_to_typestr_2(uint64, _Defs)   -> "non_neg_integer()";
  type_to_typestr_2(bool, _Defs)     -> "boolean()";
  type_to_typestr_2(fixed32, _Defs)  -> "non_neg_integer()";
  type_to_typestr_2(fixed64, _Defs)  -> "non_neg_integer()";
  type_to_typestr_2(sfixed32, _Defs) -> "integer()";
  type_to_typestr_2(sfixed64, _Defs) -> "integer()";
  type_to_typestr_2(float, _Defs)    -> "float()";
  type_to_typestr_2(double, _Defs)   -> "float()";
  type_to_typestr_2(string, _Defs)   -> "string()";
  type_to_typestr_2(bytes, _Defs)    -> "binary()";
  type_to_typestr_2({enum,E}, Defs)  -> enum_typestr(E, Defs);
  type_to_typestr_2({msg,M}, _DEfs)  -> ?f("#~p{}", [M]).
  
  enum_typestr(E, Defs) ->
      {value, {{enum,E}, Enumerations}} = lists:keysearch({enum,E}, 1, Defs),
  
negative.code:                    [FieldTxt2, LineUpStr2, FNum,
                      [", " || TypeComment /= ""], TypeComment]);
             ({I, #gpb_oneof{name=Name}=Field}) ->
                  TypeStr = ?f("~s", [type_to_typestr(Field, Defs, CompileOpts)]),
                  CommaSep = if I < length(Fields) -> ",";
                                true               -> "" %% last entry
                             end,
  