You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "James E. King, III (JIRA)" <ji...@apache.org> on 2017/03/27 16:38:41 UTC

[jira] [Assigned] (THRIFT-4143) Order of struct and enum affect generation results

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

James E. King, III reassigned THRIFT-4143:
------------------------------------------

    Assignee: James E. King, III

> Order of struct and enum affect generation results
> --------------------------------------------------
>
>                 Key: THRIFT-4143
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4143
>             Project: Thrift
>          Issue Type: Question
>          Components: Compiler (General)
>    Affects Versions: 0.9.3
>            Reporter: Mykhailo Kozik
>            Assignee: James E. King, III
>
> 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)