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

Bryan Duxbury commented on THRIFT-409:
--------------------------------------

The generic constructor is intentionally type-unsafe for flexibility. If you 
want type safety, you can use the FooUnion.field_name() style static helper 
constructors. Those are type safe and guarantee that you are getting the field 
id you expected.

I made the choice not to use a ton of generated code in TUnion because it 
greatly simplifies the generator and makes the code much easier to follow. 

> Add "union" to Thrift
> ---------------------
>
>                 Key: THRIFT-409
>                 URL: https://issues.apache.org/jira/browse/THRIFT-409
>             Project: Thrift
>          Issue Type: New Feature
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>             Fix For: 0.2
>
>         Attachments: one_rule.diff, thrift-409-v2.patch, thrift-409-v3.patch, 
> thrift-409-v4.patch, thrift-409-v5.patch, thrift-409-v6.patch, 
> thrift-409-v7.patch, thrift-409.patch
>
>
> It would be very helpful to have a "union" construct in Thrift. Let's decide 
> on the design and then break up into sub-issues to add this feature.

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

Reply via email to