Is this legal? Does it contain a hidden bug or flaw? Visual studio does not give any errors or warnings but ReSharper does:
///
/// immutable
I'm pretty sure I've heard that this is a compiler bug, fixed in the next release. I'm just firing up my 4.0 VM, with a simpler test-case:
class Foo {
public Foo() : this(delegate { this.Bar(); }) { }
public Foo(Action foo) {}
public void Bar() {}
}
works in VS2008, but in VS2010:
Error 1 Keyword 'this' is not available in the current context