Is modifying a value type from within a using statement undefined behavior?
This one's really an offshoot of this question , but I think it deserves its own answer. According to section 15.13 of the ECMA-334 (on the using statement, below referred to as resource-acquisition ): Local variables declared in a resource-acquisition are read-only, and shall include an initializer. A compile-time error occurs if the embedded statement attempts to modify these local variables (via assignment or the ++ and -- operators) or pass them as ref or out parameters. This seems to explain why the code below is illegal. struct Mutable : IDisposable { public int Field; public void