JDK-8175794 : Type inference regression after JDK-8078093
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2017-02-23
  • Updated: 2017-06-27
  • Resolved: 2017-06-09
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 10
10 b12Fixed
Related Reports
Relates :  
Relates :  
Description
The following program is rejected by javac after the fix for JDK-8078093:

===
import java.util.concurrent.ExecutorService;

abstract class T {
  void f(ExecutorService s) {
    s.submit(() -> run(() -> {}));
  }

  abstract <E extends Throwable> void run(ThrowableRunnable<E> action) throws E;

  public interface ThrowableRunnable<T extends Throwable> {
    void run() throws T;
  }
}
===

javac full version "9-ea+157"

T.java:5: error: incompatible types: inference variable T has incompatible bounds
    s.submit(() -> run(() -> {}));
            ^
    upper bounds: Object
    lower bounds: void
  where T is a type-variable:
    T extends Object declared in method <T>submit(Callable<T>)
1 error