Remix.run Logo
tialaramex 8 hours ago

> If enabled, it won’t let you deference a possibly-null reference.

It will moan, it doesn't stop you from doing it, our C# software is littered with intentional "Eh, take my word for it this isn't null" and even more annoying, "Eh, it's null but I swear it doesn't matter" code that the compiler moans about but will compile.

The C# ecosystem pre-dates nullable reference types and so does much of our codebase, and the result is that you can't reap all the benefits without disproportionate effort. Entity Framework, the .NET ORM is an example.

bazoom42 7 hours ago | parent | next [-]

You can certainly set unsafe null dereferencs to be a compiler error in C#. It is just not the default for reasons of backwards compatibility.

mrsmrtss 5 hours ago | parent | prev [-]

Add WarningsAsErrors for prject and you are done.