C# Puzzle: this = new Foo();

Can you imagine a situation when this code compiles and runs?

public void Reset()
{
    this = new Foo();
}

See the result: https://dotnetfiddle.net/JheuMu.

Leave a comment