You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Bryan Duxbury (JIRA)" <ji...@apache.org> on 2010/02/18 02:47:28 UTC

[jira] Closed: (THRIFT-473) constant structs that contain enum fields don't allow use of enums from external thrift files

     [ https://issues.apache.org/jira/browse/THRIFT-473?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Duxbury closed THRIFT-473.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 0.3
         Assignee: Bryan Duxbury

This was fixed incidentally a while ago.

> constant structs that contain enum fields don't allow use of enums from external thrift files
> ---------------------------------------------------------------------------------------------
>
>                 Key: THRIFT-473
>                 URL: https://issues.apache.org/jira/browse/THRIFT-473
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (General)
>    Affects Versions: 0.1
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>            Priority: Minor
>             Fix For: 0.3
>
>
> Ok... this one is a little tricky to explain. Take this example Thrift def:
> {code}
> enum my_enum {
>  ONE = 1, TWO = 2
> }
> struct my_struct {
>  1: my_enum enum_field;
> }
> const my_struct MY_STRUCT {'enum_field': ONE}
> {code}
> In this code, a constant of a struct type that contains an enum field can be declared by using just the constant name that we care about. This works today.
> Now, take another example:
> (first.thrift)
> {code}
> enum my_enum {
>  ONE = 1, TWO = 2
> }
> struct my_struct {
>  1: my_enum enum_field;
> }
> {code}
> (second.thrift)
> {code}
> include "first.thrift"
> const my_struct MY_STRUCT {'enum_field': ONE}
> {code}
> If you do this, then you get an error that causes the compiler to quit. I think this is a valid use case, so it should probably be made to work.

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