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

compile error with array of alias in golang

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 0.10.0
    • Fix Version/s: None
    • Component/s: Go - Compiler
    • Labels:
      None
    • Environment:

      mac sierra latest

      Description

      This case works well under 0.9.3 but not in 0.10.0
      -aaa.thrift
      typedef i64 SomeStruct

      -bbb.thrift
      include "aaa.thrift"
      struct AnotherStruct {
      1: required list<aaa.SomeStruct> another_struct;
      }
      ==========================================
      I read the compiled code, there will be code in "ReadFieldX" function like:
      for i := 0; i < size; i ++ {
      var _elem0 int64
      if v, err := iprot.ReadI64(); err != nil

      { return thrift.PrependError("error reading field 0: ", err) }

      else

      { _elem0 = v }

      p.EswLinkList = append(p.EswLinkList, _elem0) // <= compilation error here!
      }

      However, it is not allowed to append a int64 to an array of int64's alias.
      But this works in 0.9.3, I don't know whether this is an expected behavior?

      Thanks very much!

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Delostik Yi Zheng
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: