Can a conforming C# compiler optimize away a local (but unused) variable if it is the only strong reference to an object?
问题 See also these related resources: Does the .NET garbage collector perform predictive analysis of code? (on Stack Overflow) WP7: When does GC Consider a Local Variable as Garbage (blog article on MSDN) In other words: Can an object referenced by a local variable be reclaimed before the variable goes out of scope (eg. because the variable is assigned, but then not used again), or is that object guaranteed to be ineligible for garbage collection until the variable goes out of scope? Let me