[ 
https://issues.apache.org/jira/browse/THRIFT-5578?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Philip Lee updated THRIFT-5578:
-------------------------------
    Description: 
The thrift compiler 0.16 emits
{code:java}
#nullable disable                // suppress C# 8.0 nullable contexts (we still 
support earlier versions){code}
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 
{quote}Error    CS8370    Feature 'nullable reference types' is not available 
in C# 7.3. Please use language version 8.0 or greater.    
{quote}
It should be possible to prevent the compiler emitting this pragma.

Of course a work around is to edit the project file and set 
{code:java}
<LangVersion>8.0</LangVersion>{code}
, but this shouldn't be necessary.

 

  was:
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.


> 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
>            Priority: Minor
>
> The thrift compiler 0.16 emits
> {code:java}
> #nullable disable                // suppress C# 8.0 nullable contexts (we 
> still support earlier versions){code}
> 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 
> {quote}Error    CS8370    Feature 'nullable reference types' is not available 
> in C# 7.3. Please use language version 8.0 or greater.    
> {quote}
> It should be possible to prevent the compiler emitting this pragma.
> Of course a work around is to edit the project file and set 
> {code:java}
> <LangVersion>8.0</LangVersion>{code}
> , but this shouldn't be necessary.
>  



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

Reply via email to