anchor.diff:      gen_spec("-spec", ErlTypePrefix, F).
   
   gen_spec(SpecAttribute, ErlTypePrefix, F) ->
  +    % XXX, NOTE: use of piqic:erlname() here is a quick hack but this should be
  +    % enough; to do it properly, we'd need to resolve <Name>-input|output|error
  +    % Piqi type and use its erlang_name
  +    ErlTypeName = [ErlTypePrefix, piqic:erlname(F#func.name)],
       ErlName = F#func.erlang_name,
       Input =
           case F#func.input of
               'undefined' -> "'undefined'";
  -            _ -> [ ErlTypePrefix, ErlName, "_input()" ]
  +            _ -> [ ErlTypeName, "_input()" ]
           end,
   
       Output =
           case F#func.output of
               'undefined' -> "ok";
  -            _ -> [ "{ok, ", ErlTypePrefix, ErlName, "_output()}" ]
  +            _ -> [ "{ok, ", ErlTypeName, "_output()}" ]
           end,
   
       Error =
           case F#func.error of
               'undefined' -> "";
  -            _ -> [ " |\n    {error, ",  ErlTypePrefix, ErlName, "_error()}" ]
  +            _ -> [ " |\n    {error, ", ErlTypeName, "_error()}" ]
           end,
   
       [
  
positive.code:             _ ->
                  [[
  "                {error, Error} ->\n"
  "                    piqi_rpc_runtime:encode_error(?MODULE, fun ", ErlMod, ":gen_", ErlName, "_error/1, <<\"", ScopedName, "-error\">>, _OutputFormat, Error, Options)"
                  ]]
          end,
  
  
negative.code:                 ];
              _ ->
                  [
  "            Input = piqi_rpc_runtime:decode_input(?MODULE, fun ", ErlMod, ":parse_", ErlTypeName, "_input/1, <<\"", ScopedName, "-input\">>, _InputFormat, InputData, Options),\n"
  "            case piqi_rpc_runtime:call(Mod, ", ErlName, ", Input) of\n"
                  ]
          end,
  