[ 
https://issues.apache.org/jira/browse/TINKERPOP-2348?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17640054#comment-17640054
 ] 

ASF GitHub Bot commented on TINKERPOP-2348:
-------------------------------------------

FlorianHockmann opened a new pull request, #1875:
URL: https://github.com/apache/tinkerpop/pull/1875

   This is a follow-up to #1867 to now also enable nullable annotations to 
tests.
   
   https://issues.apache.org/jira/browse/TINKERPOP-2348
   
   Only the generated Gherkin test traversals are missing as we would have to 
let the Java `DotNetTranslator` produce C# code with nullable annotations. I 
think we should do that at some point in the future as nullable annotations are 
only enabled since .NET 6 by default and only for new projects. So, many users 
are probably still not using them.
   
   Adding the annotations also in tests revealed two (well actually three) more 
places where `null` should be allowed in Gremlin.Net itself: In 
`Traversal.Equals()` and in the `From()`/`To()` steps if the argument is a 
`Vertex`. While `null` is still not really allowed there, Gremlin throws a more 
meaningful exception message if it gets `null` and we might change that in the 
future to somehow allow `null` maybe.
   
   VOTE +1




> Enable nullable checks
> ----------------------
>
>                 Key: TINKERPOP-2348
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2348
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: dotnet
>    Affects Versions: 3.4.11
>            Reporter: Florian Hockmann
>            Assignee: Florian Hockmann
>            Priority: Minor
>             Fix For: 3.7.0
>
>
> Gremlin.NET should enable [nullable 
> checks|https://devblogs.microsoft.com/dotnet/embracing-nullable-reference-types/]
>  to clearly communicate to users what can be {{null}} in Gremlin.NET and also 
> to possibly find possible {{NullReferenceExceptions}} easier in our own code.
> The recommendation from Microsoft is to update libraries during the so-called 
> _"nullable rollout phase"_ which ends in November with the expected release 
> of .NET 5 which should have nullable checks enabled by default.
> We can add .NET Core 3.1 as an additional target framework to get the 
> nullable checks and still also target .NET Standard to stay platform 
> independent and to also still support .NET Framework and older .NET Core 
> versions.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to