Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-1346

Incorrectly generates code for 'set' return type.

Agile BoardAttach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 0.7
    • None
    • Perl - Compiler
    • None
    • Ubuntu/Centos, perl 5.10.1

    Description

      If return value is the 'set<type>', where type is sctruct, for example:

      struct Result
      {
      1: string response;
      2: i32 count;
      }
      service URLScheduler

      { set <Result> getResult(); }

      produced the following deserialize code:

      /^0$/ && do{ if ($ftype == TType::SET) {
      {
      $self->

      {success} = {};
      # ...
      $elem5 = new XXX::Thrift::Result();
      $xfer += $elem5->read($input);
      $self->{success}->{$elem5} = 1;

      which gives { "XXX::Thrift::MyType=HASH(0x935b818)" => 1, ... }

      Clearly, this is not true for the classes. It seems that this will not prevent something like that:

      $self->{success}

      ->{$elem5} = ref $elem5 ? $elem5 : 1;

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            jking3 James E. King III
            asan_13 Asyakin Andrey

            Dates

              Created:
              Updated:

              Slack

                Issue deployment