thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Clark (JIRA)" <j...@apache.org>
Subject [jira] Commented: (THRIFT-352) Implicit Enum Values should still be valid.
Date Wed, 04 Mar 2009 19:27:56 GMT

    [ https://issues.apache.org/jira/browse/THRIFT-352?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12678862#action_12678862
] 

Kevin Clark commented on THRIFT-352:
------------------------------------

This looks good on viewing (I still need to run it, I'll do that in a little bit when I get
into the office). Could you possible add a unit test? Should be quick. Just add a new file
in test/rb/generation that pulls in one of the generated thrift libs (test_struct.rb is using
SmallService I think, and should be a good example). All you'd need to do is write a test
that does assert_equal TheExpectedArray, SomeModule::VALID_VALUES.

> Implicit Enum Values should still be valid.
> -------------------------------------------
>
>                 Key: THRIFT-352
>                 URL: https://issues.apache.org/jira/browse/THRIFT-352
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (Ruby)
>            Reporter: Gary Tsang
>         Attachments: thirft_ruby_enum_patch.diff
>
>
> Currently only explicitly set enum values are added to the ValidValues set.  This makes
thrift interfaces like scribe fail
> Example:
> {code}
> #scribe thrift interface
> enum ResultCode
> {
>   OK,
>   TRY_LATER
> }
> # generated ruby code
> module ResultCode
>   OK = 0
>   TRY_LATER = 1
>   VALID_VALUES = Set.new([]).freeze
> end
> {code}
> My patch removes the check to see if the value was explicilty set, so all enumerated
types get added to the ValidValues set.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message