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

Incorrect code is generated for typedefs which use included types

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.9.1
    • Delphi - Compiler
    • None
    • Windows

    • 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

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

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment