I’m reading it as a good thing. The compiler will force you to check for null, right?
C++ is getting better at warning about null, though the static analysis isn’t perfect. Example, if I use a getter, the compiler sometimes whines
>>> . . .
Yes, that's the way I see it too Daniel.
I added the 'enable' flag to one of my test projects.
Scared me a little to see the warnings that the compiler threw up regarding 'possible null' values.
. . . but easily fixed I think
This throws on acLayout
Layout acLayout = tr.GetObject(objID, OpenMode.ForRead) as Layout;
and this on appContextMnuItem
AppContextMenuItem appContextMnuItem = mnuItem as AppContextMenuItem;
Warning CS8602 Dereference of a possibly null reference.
While these are ok:
Layout acLayout = (Layout)tr.GetObject(objID, OpenMode.ForRead);
AppContextMenuItem appContextMnuItem = (AppContextMenuItem)mnuItem ;
So it looks like we'll make sure of casting.
another:
PromptPointResult pointResult = default;
for pointResult
Warning CS8600 Converting null literal or possible null value to non-nullable type.