Closed AartBluestoke closed 5 years ago
Hi, thanks for reporting. Currently each MethodeInvocation are analysed independently from each other, causing this bug. I think this should be possible to fix. The problem CodeFixes should be gone automatically, since the there will be no more "undispose anonymous variable" warnings
Will be part of release 1.7.0
Prerequisites
Description
if you have a condition to decide which of 2 potential disposables (eg, 2 different ways to get a database connection) inside the using statement, then it warns that they are not disposed, even though the one returned to the using will be.
Source Code
Screenshot
also the suggested 'fix' changes the semantic behaviour to always create that IDisposable from the call, rather than just the one we decide to use.