title: Why does an empty lambda and constructor with an explicit return cause a compiler error (Java Bug?)
body: <p>I have a reproducible test case:</p>
  
  <pre><code>public class TestCase {
  
      private final java.util.function.Consumer&lt;Object&gt; emptyCallback = result -&gt; {};
  
      public TestCase() {
          return;
      }
  
      public static void main(String... args) {
          new TestCase();
      }
  }
  </code></pre>
  
  <p>Using Java 8, update 51 (Oracle JDK). This can't be compiled, using both IntelliJ and javac.</p>
  
  <p>IntelliJ output:</p>
  
  <pre><code>Error(6, 7): java: variable result might not have been initialized
  </code></pre>
  
  <p>javac output:</p>
  
  <pre><code>TestCase.java:6: error: Variable result might not have been initialized
          return;
          ^
  1 error
  </code></pre>
  
  <p>Now what is strange, is that removing <code>return;</code> or the <code>Consumer</code> will fix the error. Is this a java bug, or is there something of the language design that I am missing here?</p>
  
  <p>Edit: This is not a duplicate of <a href="https://stackoverflow.com/questions/2574276/java-how-can-a-constructor-return-a-value">How can a constructor return a value</a>, this is actually a constructor and isn't about the return value of constructor but variable initialization.</p>