[ 
https://issues.apache.org/jira/browse/THRIFT-4392?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16264875#comment-16264875
 ] 

ASF GitHub Bot commented on THRIFT-4392:
----------------------------------------

GitHub user chetmurthy opened a pull request:

    https://github.com/apache/thrift/pull/1417

    THRIFT-4392 reorder structs in plugin.thrift

    build thrift, generated ocaml from plugin.thrift, verified that compile 
fails.
    then applied patch, rebuild thrift, regen ocaml, recompile and compiler 
doesn't fail.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/chetmurthy/thrift thrift-4392

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/thrift/pull/1417.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1417
    
----
commit 431efe864df62a0c8511ddc290cda5d2c062ab0f
Author: Chet Murthy <chet...@gmail.com>
Date:   2017-11-24T02:03:01Z

    THRIFT-4392 reorder structs in plugin.thrift

----


> compiler/..../plugin.thrift structs mis-ordered blows up ocaml generator
> ------------------------------------------------------------------------
>
>                 Key: THRIFT-4392
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4392
>             Project: Thrift
>          Issue Type: Bug
>          Components: OCaml - Compiler
>    Affects Versions: 0.10.0
>         Environment: Ubuntu 16.04 Linux amd64
> ocaml 4.04.2
>            Reporter: Chet Murthy
>            Priority: Minor
>         Attachments: patch
>
>
> in plugin.thrift, the structs are ordered
> ....
> t_struct
> t_field
> ....
> but t_struct refers to t_field.  So when I gen ocaml code:
> thrift//compiler/cpp/thrift -r --gen ocaml 
> thrift/compiler/cpp/src/thrift/plugin/plugin.thrift
> and compile:
> ocamlfind ocamlc -thread -package thrift -c gen-ocaml/plugin_types.mli
> File "gen-ocaml/plugin_types.mli", line 284, characters 23-30:
> Error: Unbound type constructor t_field
> Fixing is easy (since the types aren't recursive) -- just swap the order of 
> the structs.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to