title: Why do lambdas in Java 8 disallow forward reference to member variables where anonymous classes don't?
body: <p>The following class contains a member variable <code>runnable</code> which is initialized with an instance of an anonymous inner class. The inner class references the same member:</p>
  
  <pre><code>class Example {
      Runnable runnable = new Runnable() {
          @Override
          public void run() {
              System.out.println(runnable);
          }
      };
  }
  </code></pre>
  
  <p>This is not a problem as long as the method is not executed before the member has been assigned and the JLS allows such a reference.</p>
  
  <p>The declaration of the member variable could theoretically be converted to a lambda expression like this:</p>
  
  <pre><code>Runnable runnable = () -&gt; System.out.println(runnable);
  </code></pre>
  
  <p>To my understanding, this is functionally equivalent to the previous example, but it is rejected by <code>javac 1.8.0_05</code> with the following error message:</p>
  
  <pre><code>Error:(2, 54) java: self-reference in initializer
  </code></pre>
  
  <p>While that statement is true, I do not see why this was disallowed. Was this intentionally disallowed, maybe because lambda expressions are compiled to different byte code which would lead to problems if it was allows? Or was just disallowed because there were already problems with these references when they were used in anonymous inner classes? Or was it unintentionally disallowed by the JLS writers? Or is it a bug in <code>javac</code>?</p>