I'm updating an older solution with millions of LoC to NRT. The process is going through several iterations.
How can I find null forgiving (!), null coalescing (??), and optional chaining (?.) operators that have become obsolete without having to look at all of them?
Pointless sample code just because SO likes its sample codes:
#nullable enable
// Solution/SectionA/SubZ/Project42/Thing.cs
class Thing
{
// This property had its nullability changed at some point
// by someone else and you don't know this happened.
public string/*?*/ Prop { get; set; } = "";
}
// Imagine several hundred files with thousands of lines
// Solution/SectionB/SubY/Project4711/App.cs
class App
{
public void Method(Thing t)
{
Console.WriteLine(t.Prop?.Substring(3)); // How do you find this ?. ?
}
}
Simply searching for usages of Thing.Prop is not possible, since I would have to know that Thing.Prop changed, which I don't.