BADF00D / DisposableFixer

This is a Visual Studio Extension and NuGet package that should identify and fix problems as memleaks while using IDisposables.
Other
35 stars 7 forks source link

Using expression syntax for method declarations doesnt notify of undisposed object #140

Closed Claye-L closed 4 years ago

Claye-L commented 4 years ago

Prerequisites

Description

Instantiating a disposable using method expression syntax doesn't highlight it whereas using the full bracket syntax does.

Source Code

void MakeStream() => new MemoryStream();
void MakeStreamToo()
  {
     var m = new MemoryStream();
  }

Screenshot

image

BADF00D commented 4 years ago

Hi, thanks for reporting. I actually was not aware, that the first expression is valid C# code. I thought there have to be an return type. Should be easy to fix.

BADF00D commented 4 years ago

Will be part of release 2.4.1 for Visual Studio 2017 and 3.2.1 for Visual Studio 2019