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

Defaults applied to service method arguments not working as expected

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Compiler (General)
    • Labels:

      Description

      Problem

      service Foobar {
        void Test( 1: i32 someValue = 42)
      }
      

      The default of 42 is set into the Test_Args structure in most languages, but later overwritten because the generated calls do completely ignore these defaults. One has always to call:

      client.Test( 1);
      client.Test( 42);
      client.Test( 4711);
      

      instead of

      client.Test( 1);
      client.Test( );  // 42 is the default
      client.Test( 4711);
      

      Applies to

      Most (all?) languages.

      Todo

      Create a sub-task for your particular language and add the patch.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                jensg Jens Geyer
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: