diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/UsingVariables.cs b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/UsingVariables.cs index e7a87435b..84cd63884 100644 --- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/UsingVariables.cs +++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/UsingVariables.cs @@ -17,12 +17,25 @@ // DEALINGS IN THE SOFTWARE. using System; +using System.Runtime.InteropServices; #if !NET40 using System.Threading.Tasks; #endif namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty { + [StructLayout(LayoutKind.Sequential, Size = 1)] + internal ref struct RefStructWithDispose + { + public void Use() + { + } + + public void Dispose() + { + } + } + public class UsingVariables { public IDisposable GetDisposable() @@ -96,5 +109,13 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty Use(asyncDisposable); } #endif + + public void UsingVarPatternBasedDispose() + { + Console.WriteLine("before using"); + using RefStructWithDispose refStructWithDispose = default(RefStructWithDispose); + Console.WriteLine("inside using"); + refStructWithDispose.Use(); + } } }