title: Should the following code compile under Java 1.8
body: <p>given the following class:</p>
  
  <pre><code>public class FooTest {
  
      public static class Base {
      }
  
      public static class Derived extends Base {
      }
  
      public interface Service&lt;T extends Base&gt; {
          void service(T value);
      }
  
      public abstract class AbstractService&lt;T extends Derived&gt; implements  Service&lt;T&gt; {
          public void service(T value) {
          }
      }
  
      private AbstractService service;
  
      public void bar(Base base) {
          if(base instanceof Derived) {
              service.service(base); // compile error at this line
          }
      }
  }
  </code></pre>
  
  <p>When building the class with the following <code>pom.xml</code>:</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;com.mgm-tp&lt;/groupId&gt;
      &lt;artifactId&gt;java-compiler-test&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;build&gt;
          &lt;pluginManagement&gt;
              &lt;plugins&gt;
                  &lt;plugin&gt;
                      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                      &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                      &lt;version&gt;3.3&lt;/version&gt;
                      &lt;configuration&gt;
                          &lt;source&gt;1.8&lt;/source&gt;
                          &lt;target&gt;1.8&lt;/target&gt;
                          &lt;compilerId&gt;eclipse&lt;/compilerId&gt;
                      &lt;/configuration&gt;
                      &lt;dependencies&gt;
                          &lt;dependency&gt;
                              &lt;groupId&gt;org.codehaus.plexus&lt;/groupId&gt;
                              &lt;artifactId&gt;plexus-compiler-eclipse&lt;/artifactId&gt;
                              &lt;version&gt;2.5&lt;/version&gt;
                          &lt;/dependency&gt;
                      &lt;/dependencies&gt;
                  &lt;/plugin&gt;
              &lt;/plugins&gt;
          &lt;/pluginManagement&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>in maven 3.4 it produces the following compile error:</p>
  
  <blockquote>
    <p>[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project java-compiler-test: Compilation failure
    [ERROR] C:\Users\abrieg\workingcopy\java-compiler-test\src\main\java\FooTest.java:[25] The method service(FooTest.Base) in the type FooTest.Service is not applicable for the arguments (FooTest.Base)</p>
  </blockquote>
  
  <p>When setting source and target level to 1.7 for the eclipse compiler or when using <code>javac</code> as the compiler there is no compile error reported.</p>
  
  <p>The question is wheter JLS 1.8 is more specific about type inference such that this code is really not allowed as supposed by eclipse compiler for java 1.8 or if this is a regression in the eclipse compiler.</p>
  
  <p>Based on the text of the compiler error I tend to say its a regression, but I am not sure.</p>
  
  <p>I have identified the following two bugs already reported to jdt, but I think they do not apply exactly:<br>
  <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=432603">https://bugs.eclipse.org/bugs/show_bug.cgi?id=432603</a>
  <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=430987">https://bugs.eclipse.org/bugs/show_bug.cgi?id=430987</a></p>
  
  <p>If this is a regression, has this already been reported to jdt?</p>