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

uncompileable code with member names that are also types under specific conditions

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.12.0
    • Component/s: Delphi - Compiler
    • Labels:
      None
    • Patch Info:
      Patch Available

      Description

      enum Foobar {
        Foo = 0,
        Bar = 1,
        Baz = 2,
      }
      
      struct SomeStruct {
        1 : optional double MinValue
        2 : optional double MaxValue
        3 : optional bool Integer  // causes issue
        4 : optional Foobar Foo
      }
      

      generates uncompileable delphi code around field #4 (not 3!), because of a type cast that uses unqualified Integer.

      Workaround: don't name the field "Integer" ...

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jensg Jens Geyer
                Reporter:
                jensg Jens Geyer
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: