Disposable factory - expected to see a warning, but there wasn't #521
Open
Description
I have a factory class which creates IDisposable
s. I expect to see a warning when using the factory without disposing it's result.
However, ther is no warning.
Is there anything I can do to make a warning appear?
Here's a simplified code snippet:
public interface IDisposableFactory
{
IDisposable Create();
}
public class Example
{
void Example(IDisposableFactory factory)
{
IDisposable disposable = factory.Create(); // why no warning?
}
}
Metadata
Assignees
Labels
No labels