Not nullable not enforced?

I have the following code that I expect a NRE, or some warning/errros, but not. Did I miss anything?

not_nullable_test.7z (4.7 KB)

Thanks, logged as bugs://83758

Indeed, the call to Test() should NRE at the call site.

It does?

Unhandled Exception: System.ArgumentNullException: Value cannot be null.
Parameter name: aStr
   at ConsoleApplication1.Program.Test(String aStr)
   at ConsoleApplication1.Program.Main(String[] args)

The compiler doesn’t do compile time warnings because nothing in any framework has proper not nullable annotations, so we’d have 1000s of useless warnings.

bugs://83758 got closed with status nochangereq.


That is so strange.I understand it should be runtime exception. But I don’t see this exception thrown during run time. The build version I use is: 2470, (latest, from FireHose, just downloaded at 8:19 am, EST), and I use VS2019/Island.

ah I copied it and tested it on Echoes. I’ll try your testcas and reopen it.

bugs://83758 got reopened.

bugs://83758 got closed with status fixed.