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

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

    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

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: