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

Go redeclaration error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.9.2
    • Go - Compiler
    • None
    • Patch Available

    Description

      The following IDL code works perfectly with other languages:

      namespace * Test
      
      struct Project {
        1 : required string projectID
      }
      
      struct NewProject {
        1 : required string name
      }
      
      service Sample {
        Project CreateNewProject( 1: NewProject project) 
      }
      

      The result I get here is

      gen-go\Test\Sample.go:455: missing argument to conversion to NewProject: NewProject()
      gen-go\Test\ttypes.go:191: NewProject redeclared in this block
      previous declaration at gen-go\Test\ttypes.go:25

      Seems as if the generated NewProject() method conflicts with the struct name. As my Go knowledge is somewhat limited, I'm not sure about whether or not this issue blocks the acceptance of THRIFT-1980, so I created a new ticket.

      Attachments

        1. thrift-2009_redeclaration_error.patch
          8 kB
          Jens Geyer
        2. thrift-2009_testcase.thrift
          0.9 kB
          Jens Geyer

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: