You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Philip Lee (Jira)" <ji...@apache.org> on 2022/05/04 06:52:00 UTC

[jira] [Created] (THRIFT-5578) Thrift compiler emits #nullable disable for C# 7

Philip Lee created THRIFT-5578:
----------------------------------

             Summary: Thrift compiler emits #nullable disable for C# 7
                 Key: THRIFT-5578
                 URL: https://issues.apache.org/jira/browse/THRIFT-5578
             Project: Thrift
          Issue Type: Improvement
          Components: Compiler (General)
    Affects Versions: 0.16.0
            Reporter: Philip Lee


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.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)