[x] I have verified that I am running the latest version of DisposableFixer: 1.0.0
[x] I have searched open and closed issues to ensure it has not already been reported
Description
When awaiting a IDisposable that is not disposed, the error message is "DF0001 - Undisposed anonymous object." but in this case it is a undisposed local variable. This error only occures when assigning result of await to an local variable declared before.
Source Code
using System.IO;
using System.Threading.Tasks;
namespace DisFixerTest.Issue
{
internal class Program
{
public async void Test()
{
MemoryStream mem;
mem = await Create();
}
private Task<MemoryStream> Create()
{
return Task.FromResult(new MemoryStream());
}
}
}
Prerequisites
Description
When awaiting a IDisposable that is not disposed, the error message is "DF0001 - Undisposed anonymous object." but in this case it is a undisposed local variable. This error only occures when assigning result of await to an local variable declared before.
Source Code
Screenshot