Skip to content

Bug: CC0022 being raised on using when not assigned #319

Closed
@giggio

Description

This is incorrectly raising CC0022:

using (new SomeDisposable()) { }

It shouldn't, as the object created from SomeDisposable will disposed. The analyzer works as expected when the value is assigned, like so:

using (var d = new SomeDisposable()) { }

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions