IDISP013 should not warn when not using the disposable
JeremyMorton opened this issue · comments
Jeremy Morton commented
I am seeing this with ValueTask<>
return types:
public ValueTask<int> M1Async()
{
using (var disposable = new Disposable())
{
return new ValueTask<int>(disposable.Equals(disposable) ? 1 : 0);
}
}
public ValueTask<int> M2Async()
{
using (var disposable = new Disposable())
{
var i = disposable.Equals(disposable) ? 1 : 0;
return new ValueTask<int>(i);
}
}
Johan Larsson commented
This is a perfect issue, thanks!
Sorry about the bug
Jeremy Morton commented
This also happens if the return line for a method that returns a ValueTask
is just return default;
Johan Larsson commented
We fix things issue by issue, I don't use ValueTask
much hence the spotty support
Jeremy Morton commented
No problem! I appreciate the responsiveness.
Johan Larsson commented
I have not had much time for this library so responsiveness has not been great.