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

Incorrect code is generated for typedefs which use included types

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.9.1
    • Component/s: Delphi - Compiler
    • Labels:
      None
    • Environment:

      Windows

    • Patch Info:
      Patch Available

      Description

      If a typedef refers to a type that is defined in an included IDL file, the code for the typedef is not generated. Furthermore, the Compiler issues a warning about pending typedefs.

      If the typedef is used elsewhere in the code, the generated code cannot be compiled because of the missing code for the pending typedefs.

      Inner IDL file:

      namespace * bug.Uncompileable.Inner
      
      struct InnerStruct { }
      

      Outer IDL file:

      namespace * bug.Uncompileable.Outer
      
      include "bug_codegen_inner.thrift"
      
      struct AnotherStruct
      {
      }
      
      typedef bug_codegen_inner.InnerStruct OuterStruct
      typedef AnotherStruct AnotherRedefined
      
      struct OuterContainer {
        1: AnotherRedefined MoreData
        2: OuterStruct  SomeData
      }
      

      In this example, the typedef for OuterStruct is not generated, thus Delphi fails to compile OuterContainer.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jensg Jens Geyer
                Reporter:
                jensg Jens Geyer
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: