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
            Priority: Minor


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.

Reply via email to