-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Labels
Description
Input code
using System;
using (new Str()) ;
struct Str : IDisposable
{
public void Dispose() {}
}Erroneous output
Str str = default(Str);
try
{
}
finally
{
// this is wrong
((IDisposable)str).Dispose();
// structs do not box in using pattern
// see corresponding blog post from Eric Lippert
// https://stackoverflow.com/a/2413844/5647513
}Details
Also tested in ILSpy version 8.1.1.7464.