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

Swift generator does not escape keywords properly

    XMLWordPrintableJSON

    Details

      Description

      1. For field `protocol` in a struct:
      generated:

          try proto.validateValue(protocol, named: "protocol")
      

      expected:

          try proto.validateValue(`protocol`, named: "protocol")
      

      2. Swift allows any keyword to be used as identifier if you escape it, so lang_keywords() should return empty set.
      Adjust keyword test appropriately.

      3. kewords_(lang_keywords()) initialization in t_generator.h does not work. Virtual method call from base class constructor. This mechanism is used for Python and Swift. Fixing this issue changes list of reserved words for Python and Swift (breaking change).

      https://github.com/apache/thrift/pull/2059

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                janosvitok Jano Svitok
                Reporter:
                janosvitok Jano Svitok
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h