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

Use enum names instead of casted integers in assignments

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.9.1
    • Delphi - Compiler
    • None
    • Patch Available

    Description

      Same as in THRIFT-1318 with C#.
      It makes more sense to write

      Self.Property = TMyEnumType.SomeValue;
      

      instead of the C-ish casting style like in

      Self.Property = TMyEnumType(-42);
      

      And since it seems not to be possible to assign values other than the IDL-defined enum values, there is no reason left to use the cast.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: