Why does a recursive constructor call make invalid C# code compile?
<p>After watching webinar <em><a href="http://blogs.jetbrains.com/dotnet/2013/04/webinar-recording-jon-skeet-inspects-resharper/">Jon Skeet Inspects ReSharper</a></em>, I've started to play a little with
recursive constructor calls and found, that the following code is valid C# code (by valid I mean it compiles).</p>

<pre><code>class Foo
{
    int a = null;
    int b = AppDomain.CurrentDomain;
    int c = "string to int";
    int d = NonExistingMethod();
    int e = Invalid&lt;Method&gt;Name&lt;&lt;Indeeed();

    Foo()       :this(0)  { }
    Foo(int v)  :this()   { }
}
</code></pre>

<p>As we all probably know, field initialization is moved into constructor by the compiler. So if you have a field like <code>int a = 42;</code>, you will have <code>a = 42</code> in <strong>all</strong> constructors. But if you have constructor calling another constructor, you will have initialization code only in called one.</p>

<p>For example if you have constructor with parameters calling default constructor, you will have assignment <code>a = 42</code> only in the default constructor.</p>

<p>To illustrate second case, next code:</p>

<pre><code>class Foo
{
    int a = 42;

    Foo() :this(60)  { }
    Foo(int v)       { }
}
</code></pre>

<p>Compiles into:</p>

<pre><code>internal class Foo
{
    private int a;

    private Foo()
    {
        this.ctor(60);
    }

    private Foo(int v)
    {
        this.a = 42;
        base.ctor();
    }
}
</code></pre>

<p>So the main issue, is that my code, given at the start of this question, is compiled into:</p>

<pre><code>internal class Foo
{
    private int a;
    private int b;
    private int c;
    private int d;
    private int e;

    private Foo()
    {
        this.ctor(0);
    }

    private Foo(int v)
    {
        this.ctor();
    }
}
</code></pre>

<p>As you can see, the compiler can't decide where to put field initialization and, as result, doesn't put it anywhere. Also note, there are no <code>base</code> constructor calls. Of course, no objects can be created, and you will always end up with <code>StackOverflowException</code> if you will try to create an instance of <code>Foo</code>.</p>

<p>I have two questions:</p>

<p><strong>Why does compiler allow recursive constructor calls at all?</strong></p>

<p><strong>Why we observe such behavior of the compiler for fields, initialized within such class?</strong></p>

<hr>

<p>Some notes: <a href="http://en.wikipedia.org/wiki/ReSharper">ReSharper</a> warns you with <code>Possible cyclic constructor calls</code>. Moreover, in Java such constructor calls won't event compile, so the Java compiler is more restrictive in this scenario (Jon mentioned this information at the webinar).</p>

<p>This makes these questions more interesting, because with all respect to Java community, the C# compiler is <em>at least</em> more modern.</p>

<p>This was compiled using <a href="http://en.wikipedia.org/wiki/C_Sharp_4.0">C# 4.0</a> and <a href="http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29#Versions">C# 5.0</a> compilers and decompiled using <a href="http://www.jetbrains.com/decompiler/">dotPeek</a>.</p>
