You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Jens Geyer (Jira)" <ji...@apache.org> on 2022/05/05 08:07:00 UTC
[jira] [Resolved] (THRIFT-5578) #nullable disable collides with C# lang versions < 8
[ https://issues.apache.org/jira/browse/THRIFT-5578?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jens Geyer resolved THRIFT-5578.
--------------------------------
Resolution: Fixed
Good catch, thanks. The <auto-generated> tag should be enough anyway so I simply removed it.
https://docs.microsoft.com/en-us/dotnet/csharp/nullable-references
> #nullable disable collides with C# lang versions < 8
> ----------------------------------------------------
>
> Key: THRIFT-5578
> URL: https://issues.apache.org/jira/browse/THRIFT-5578
> Project: Thrift
> Issue Type: Bug
> Components: netstd - Compiler
> Affects Versions: 0.16.0
> Reporter: Philip Lee
> Assignee: Jens Geyer
> Priority: Minor
> Fix For: 0.17.0
>
> Attachments: 0001-THRIFT-5578-nullable-disable-collides-with-C-lang-ve.patch
>
>
> 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)