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

#nullable disable collides with C# lang versions < 8 (error CS8370)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.16.0
    • 0.17.0
    • netstd - Compiler
    • None

    Description

      The thrift compiler 0.16 emits

      #nullable disable                // suppress C# 8.0 nullable contexts (we still support earlier versions)

      However since you're supporting .NET Standard your Nuget package can be used for .NET Framework projects which use C# version <= 7.3.

      This then causes an error 

      Error    CS8370    Feature 'nullable reference types' is not available in C# 7.3. Please use language version 8.0 or greater.    

      It should be possible to prevent the compiler emitting this pragma.

      Of course a work around is to edit the project file and set 

      <LangVersion>8.0</LangVersion>

      but this shouldn't be necessary.

       

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: