IDISP004 doesn't warn when `Task<>.FromResult(disposable)` is returned by a method, but does when `new ValueTask<>(disposable)` is returned.)
JeremyMorton opened this issue · 1 comments
JeremyMorton commented
Can returning a disposable object as the result of a ValueTask<>
not raise this. returning a disposable object as the result of a Task<>
already doesn't raise it.
JohanLarsson commented
Ah, I rarely use ValueTask
so support is still limited, thanks for the issue!
When reporting issues minimal sample code reproducing the bug saves time for me.
Ideally something minimal like:
public ValueTask<IDisposable> M()
{
var disposable = new Disposable();
return new ValueTask<IDisposable>(disposable);
}
Also you mean IDISP001 right?