title: bad return type in lambda expression
body: <p>The following code compiles fine in IntelliJ and Eclipse, but the JDK compiler 1.8.0_25 complains. First, the code.</p>
  
  <pre><code>import java.util.function.Predicate;
  
  public abstract class MyStream&lt;E&gt; {
  
    static &lt;T&gt; MyStream&lt;T&gt; create() {
      return null;
    }
  
    abstract MyStream&lt;E&gt; filter(MyPredicate&lt;? super E&gt; predicate);
  
    public interface MyPredicate&lt;T&gt; extends Predicate&lt;T&gt; {
  
      @Override
      boolean test(T t);
    }
  
    public void demo() {
      MyStream.&lt;Boolean&gt; create().filter(b -&gt; b);
      MyStream.&lt;String&gt; create().filter(s -&gt; s != null);
    }
  }
  </code></pre>
  
  <p>The output from javac 1.8.0_25 is:</p>
  
  <pre><code>MyStream.java:18: error: incompatible types: incompatible parameter types in lambda expression
      MyStream.&lt;Boolean&gt; create().filter(b -&gt; b);
                                         ^
  MyStream.java:18: error: incompatible types: bad return type in lambda expression
      MyStream.&lt;Boolean&gt; create().filter(b -&gt; b);
                                              ^
      ? super Boolean cannot be converted to boolean
  MyStream.java:19: error: bad operand types for binary operator '!='
      MyStream.&lt;String&gt; create().filter(s -&gt; s != null);
                                               ^
    first type:  ? super String
    second type: &lt;null&gt;
  MyStream.java:19: error: incompatible types: incompatible parameter types in lambda expression
      MyStream.&lt;String&gt; create().filter(s -&gt; s != null);
                                        ^
  Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
  4 errors
  </code></pre>
  
  <p>When I replace <code>? super E</code> with simply <code>E</code>, JDK compiles successfully.</p>
  
  <p>When I replace <code>filter(MyPredicate</code> with <code>filter(Predicate</code>, JDK compiles successfully.</p>
  
  <p>Since it works with JDK 1.8.0_60, I suspect it is a compiler bug.</p>
  
  <p>Any details on what caused this and when it has been fixed?</p>