Closed bitbonk closed 3 months ago
Hi @bitbonk,
I was not able to reproduce the issue using your snippet. It seems you are also using an outdated version of our analyzer. I would recommend updating to our latest version, 9.27.0.93347 (9.28 is likely to be released tomorrow). Anyway, the issue you are reporting looks very similar to #8413. A precondition needed to solve this specific issue was merged a few days ago. Feel free to check that issue to keep track of the progress.
Thanks!
Description
Sometimes it is required to explicitly cast from
Foo
toFoo?
in a nullable reference context. For example to get rid of the CS8619 compiler warning.In the below example, if we remove the
(object?)
cast that S1905 is complaining about, we get the following compiler warning:Repro steps
Expected behavior
The rule S1905 does not complain.
Actual behavior
The rule S1905 complains:
Related information