Created
September 28, 2023 06:27
-
-
Save cboudereau/7a64247192a68d75b208dca68bddaa88 to your computer and use it in GitHub Desktop.
csharp_nested_using.csx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
public class C { | |
private class D : IDisposable { | |
public D() | |
{ | |
} | |
public D(IDisposable _):this() { | |
} | |
public void Dispose(){ | |
} | |
} | |
public void M() { | |
using (var a = new D()) | |
using (var b = new D(a)) | |
using (var c = new D(b)){ | |
System.Console.WriteLine("hello world"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment