C# Puzzle: this = new Foo();
Can you imagine a situation when this code compiles and runs? [code lang=”csharp” light=”true”] public void Reset() { this = new Foo(); } [/code] See the result: https://dotnetfiddle.net/JheuMu.
Robert Haken
1 min read