Trying to narrow down a FP found in a relatively complex method, I managed to reproduce two FPs with the following code:
private static void Test(Action<string> action)
{
string? str = "xyz";
LocalFunction();
void LocalFunction()
{
action(str!);
}
}
The first FP is S1172 on the action parameter and it seems that it happens only if “!” is appended to the argument passed to the function (in order to suggest the nullable variable is not null here), very strange… Also, it does not appear if action is invoked from the main function and not the local function. The behaviour is the same if nullable is enabled or disabled in the project.
The other FP is S1854 as it seems that the analyzer doesn’t recognize that action is later used in LocalFunction. This one doesn’t depend on the “!”
The analyzer version is 8.4.0.15306