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

Defaults applied to service method arguments not working as expected

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Compiler (General)

    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

              Unassigned Unassigned
              jensg Jens Geyer
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: