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

Lua Generator does not support const i64

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.14.2
    • 0.15.0
    • Lua - Compiler

    Description

       in thrift file:
      const i64 ALuaConst= 0x1

      in generated lua file:
      ALuaConst = lualongnumber.new('')

      bug is here:
      https://github.com/apache/thrift/blob/4434ee92d5141578cecac95ee53e3563101b9ecd/compiler/cpp/src/thrift/generate/t_lua_generator.cc#L262
      should replace get_string() with get_integer()
      beacuse according to
      https://github.com/apache/thrift/blob/4434ee92d5141578cecac95ee53e3563101b9ecd/compiler/cpp/src/thrift/parse/t_scope.h#L153
      when const type == i64, set_string() is unreachable, then get_string() will always return "".

      Attachments

        Issue Links

          Activity

            People

              HKBHKB KaibinHuang
              HKBHKB KaibinHuang
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 5m Original Estimate - 5m
                  5m
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 50m
                  50m