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/02/05 02:00:00 UTC

[jira] [Updated] (THRIFT-5511) Full support for the new net6 "nullability" semantics

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

Jens Geyer updated THRIFT-5511:
-------------------------------
    Description: 
This is sort of an follow-up to THRIFT-5479.

The initially chosen solution was to [add an {{<autogenerate>}} tag |https://docs.microsoft.com/en-us/dotnet/csharp/nullable-references#nullable-contexts]to each generated C# source file, because otherwise the analysis would drop a whole lot of messages onto the user. One major reason behind this design was that it does not break compatibility.

It turned out that that actually may do more harm than good, because of [this issue|https://github.com/dotnet/roslyn/issues/44063], which has a really great potential to lead the developer into a false security, believing what the IDE tells, that values in some cases are not null - but what it really should say is "{_}I did not analyze this code so I cannot safely tell anything{_}".

Hence, we should have better support for it.

  was:
This is sort of an follow-up to THRIFT-5479.

The initially chosen solution was to [add an {{<autogenerate>}} tag |https://docs.microsoft.com/en-us/dotnet/csharp/nullable-references#nullable-contexts]to each generated C# source file, because otherwise the analysis would drop a whole lot of messages onto the user. One major reason behind this design was that it does not break compatibility.

It turned out that that actually may do more harm than good, because of [this issue|https://github.com/dotnet/roslyn/issues/44063], which has a really great potential to lead the developer into a false security, believing the IDE that values in some cases are not null - what it really should say is "I did not analyze this code so I cannot tell".

Hence, we should have better support for it.


> Full support for the new net6 "nullability" semantics 
> ------------------------------------------------------
>
>                 Key: THRIFT-5511
>                 URL: https://issues.apache.org/jira/browse/THRIFT-5511
>             Project: Thrift
>          Issue Type: Improvement
>          Components: netstd - Compiler
>    Affects Versions: 0.16.0
>         Environment: [net6 / C# 10|https://stackoverflow.com/a/247623/499466]
>            Reporter: Jens Geyer
>            Assignee: Jens Geyer
>            Priority: Major
>
> This is sort of an follow-up to THRIFT-5479.
> The initially chosen solution was to [add an {{<autogenerate>}} tag |https://docs.microsoft.com/en-us/dotnet/csharp/nullable-references#nullable-contexts]to each generated C# source file, because otherwise the analysis would drop a whole lot of messages onto the user. One major reason behind this design was that it does not break compatibility.
> It turned out that that actually may do more harm than good, because of [this issue|https://github.com/dotnet/roslyn/issues/44063], which has a really great potential to lead the developer into a false security, believing what the IDE tells, that values in some cases are not null - but what it really should say is "{_}I did not analyze this code so I cannot safely tell anything{_}".
> Hence, we should have better support for it.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)