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

Uncompilable code when .thrift struct 'System' exists

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.15.0
    • 0.16.0
    • netstd - Compiler
    • None
    • Visual Studio 2022

      .netstandard-2.0 Project

    Description

      If you have an struct in your .thrift definition with the name 'System', the thrift compile generates uncompilable code for the Equals() method. As the namespace 'System' gets interpreted as class. It could be fixed with prefixing theĀ  System.Object.Equals() calls with 'global::' as it is done nearly everywhere else where non simple types are used.

      The following compiles:

      Yes I also think naming a struct 'System' is not a good idea, but here we are

      Attachments

        1. image-2022-01-20-14-37-18-452.png
          194 kB
          Jonas Marty
        2. image-2022-01-20-14-27-34-063.png
          188 kB
          Jonas Marty

        Issue Links

          Activity

            People

              jensg Jens Geyer
              jonas.m Jonas Marty
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m