[X] I have verified that I am running the latest version of DisposableFixer: 1.6.0
[X] I have searched open and closed issues to ensure it has not already been reported
Description
yield return of a disposable warns about an undisposed object, while a simple return is flagged safe. ; i would not expect this inconsistency.
Source Code
class someTest
{
static IDisposable f()=>null;
IEnumerable<IDisposable> f2()
{
foreach(var r in Enumerable.Range(1, 10))
{
yield return f(); // warning here -- would expect the warning status to be the same as below.
}
}
IDisposable f3()
{
return f(); // no warning here
}
}
Prerequisites
Description
yield return of a disposable warns about an undisposed object, while a simple return is flagged safe. ; i would not expect this inconsistency.
Source Code
Screenshot