thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mykhailo Kozik (JIRA)" <j...@apache.org>
Subject [jira] [Created] (THRIFT-4143) Order of struct and enum affect generation results
Date Mon, 27 Mar 2017 13:36:41 GMT
Mykhailo Kozik created THRIFT-4143:
--------------------------------------

             Summary: Order of struct and enum affect generation results
                 Key: THRIFT-4143
                 URL: https://issues.apache.org/jira/browse/THRIFT-4143
             Project: Thrift
          Issue Type: Bug
          Components: Java - Compiler
    Affects Versions: 0.9.3
            Reporter: Mykhailo Kozik


The following thrift IDL produce generation error 

{code}
namespace java com.mishadoff.sample

struct Request {
  1: optional Mode mode = Mode.APPEND
}

enum Mode {
  APPEND = 1
  OVERWRITE = 2
}
{code}

{code}
[FAILURE:/Users/mkoz/temp/enum_order.thrift:5] No enum value or constant found named "Mode.APPEND"!
{code}

However, if you put enum before struct it compiles fine. Should order of structs or enums
impact the compilation process?

{code}
namespace java com.mishadoff.sample

enum Mode {
  APPEND = 1
  OVERWRITE = 2
}

struct Request {
  1: optional Mode mode = Mode.APPEND
}
{code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message