Top "Nullable-reference-types" questions

For issues related to C# 8's nullable reference types.

The annotation for nullable reference types should only be used in code within a '#nullable' context

Just downloaded VS2019 and created a console app to try out the new C# 8 null reference types. Switched the project …

c# c#-8.0 nullable-reference-types
How to enable Nullable Reference Types feature of C# 8.0 for the whole project

According to the C# 8 announcement video the "nullable reference types" feature can be enabled for the whole project. But how …

c# visual-studio visual-studio-2019 c#-8.0 nullable-reference-types
What does null! statement mean?

I've recently seen the following code: public class Person { //line 1 public string FirstName { get; } //line 2 public string LastName { get; } = null!; //…

c# c#-8.0 nullable-reference-types
Why does this code give a "Possible null reference return" compiler warning?

Consider the following code: using System; #nullable enable namespace Demo { public sealed class TestClass { public string Test() { bool isNull = _test == …

c# nullable-reference-types