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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.12.0
    • Delphi - Compiler
    • None
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: