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

Implicit Enum Values should still be valid.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • Ruby - Compiler
    • None
    • Patch Available

    Description

      Currently only explicitly set enum values are added to the ValidValues set. This makes thrift interfaces like scribe fail

      Example:

      #scribe thrift interface
      enum ResultCode
      {
        OK,
        TRY_LATER
      }
      
      # generated ruby code
      module ResultCode
        OK = 0
        TRY_LATER = 1
        VALID_VALUES = Set.new([]).freeze
      end
      

      My patch removes the check to see if the value was explicilty set, so all enumerated types get added to the ValidValues set.

      Attachments

        1. enum_test.rb
          0.5 kB
          Gary Tsang
        2. thirft_ruby_enum_patch.diff
          0.7 kB
          Gary Tsang

        Issue Links

          Activity

            People

              garru Gary Tsang
              garru Gary Tsang
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: