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:01:41 UTC

[jira] [Commented] (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:comment-tabpanel&focusedCommentId=15943519#comment-15943519 ] 

James E. King, III commented on THRIFT-4143:
--------------------------------------------

I do not see this as an error.  The same thing would happen in a C compilation.

> 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)