title: Functional Interface Inheritance Quirk
body: <p>I have a custom interface I've been using for some time that looks something like this:</p>
  
  <pre><code>public interface Function&lt;T, R&gt; {
      R call(T input);
  }
  </code></pre>
  
  <p>I'd like to retrofit this interface with both Java's <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/Function.html"><code>Function</code></a> as well as Guava's <a href="http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/base/Function.html"><code>Function</code></a>, while keeping it a <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/FunctionalInterface.html"><code>FunctionalInterface</code></a>. I thought I had the perfect arrangement:</p>
  
  <pre><code>@FunctionalInterface
  public interface Function&lt;T, R&gt; extends
          java.util.function.Function&lt;T, R&gt;,
          com.google.common.base.Function&lt;T, R&gt; {
  
      R call(T input);
  
      @Override
      default R apply(T input) {
          return call(input);
      }
  }
  </code></pre>
  
  <p>Both superinterfaces declare the same <code>apply()</code> method, which has been implemented in my interface, leaving only the abstract <code>call()</code> method. Strangely, it won't compile, telling me</p>
  
  <blockquote>
    <p>Invalid '@FunctionalInterface' annotation; Function&lt;T,R&gt; is not a functional interface</p>
  </blockquote>
  
  <p>Stranger still, the following variations compile just fine:</p>
  
  <pre><code>@FunctionalInterface
  public interface Function&lt;T, R&gt; extends
          java.util.function.Function&lt;T, R&gt; {
  
      R call(T input);
  
      @Override
      default R apply(T input) {
          return call(input);
      }
  }
  </code></pre>
  
  <p></p>
  
  <pre><code>@FunctionalInterface
  public interface Function&lt;T, R&gt; extends
          com.google.common.base.Function&lt;T, R&gt; {
  
      R call(T input);
  
      @Override
      default R apply(T input) {
          return call(input);
      }
  }
  </code></pre>
  
  <p></p>
  
  <pre><code>public interface Function&lt;T, R&gt; extends
          java.util.function.Function&lt;T, R&gt;,
          com.google.common.base.Function&lt;T, R&gt; {
  
      R call(T input);
  
      @Override
      default R apply(T input) {
          return call(input);
      }
  }
  </code></pre>
  
  <p></p>
  
  <pre><code>@FunctionalInterface
  public interface Function&lt;T, R&gt; extends
          java.util.function.Function&lt;T, R&gt;,
          com.google.common.base.Function&lt;T, R&gt; {
  
      @Override
      R apply(T input);
  }
  </code></pre>
  
  <p>Is there a reason the first version won't compile?</p>