Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-4392

compiler/..../plugin.thrift structs mis-ordered blows up ocaml generator

VotersStop watchingWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.10.0
    • 0.11.0
    • OCaml - Compiler
    • None
    • Ubuntu 16.04 Linux amd64
      ocaml 4.04.2

    Description

      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.

      Attachments

        1. patch
          0.7 kB
          Chet Murthy

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            jking3 James E. King III
            chetmurthy Chet Murthy
            Votes:
            0 Vote for this issue
            Watchers:
            3 Stop watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment