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

Incorrect and inconsistency in compiler generated go code regarding pointer types

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 0.15.0, 0.14.2
    • None
    • Go - Compiler
    • None

    Description

      This is the continuation/followup fromĀ THRIFT-5389 and THRIFT-5461.

      1. For container fields of a struct (map/list/set), we make the container type a point when it has default value set, but we didn't handle that correctly when generating the constant value (part of THRIFT-3289 but missed from the fix)
      2. The decision on whether to make string/binary fields of a struct's type a pointer is inconsistent from container types. For container types we make it a pointer when it has a default value, so we determine IsSet* by checking if the pointer is nil. But for string we make it not a pointer when it has default value, and determine IsSet* by checking if the value is the same as the default. We should make them consistent.

      Attachments

        Activity

          People

            Unassigned Unassigned
            fishywang Yuxuan Wang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: