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

Use enum names instead of casted integers in assignments

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.9.1
    • Component/s: Delphi - Compiler
    • Labels:
      None
    • Patch Info:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: