JDK-8191655 : LambdaConversionException: Invalid receiver type interface; not a subtype of implementation type interface
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2017-11-21
  • Updated: 2018-11-09
  • Resolved: 2017-11-22
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 b33Fixed
Related Reports
Relates :  
Description
Unfinished leftover work from JDK-8058112.

The following program crashes with 
LambdaConversionException: Invalid receiver type interface

public class SortedInterfacesTest {
   <T> void forAll(Consumer<T> consumer, T... values) { }

   public void secondTest() {
       forAll(Picture::draw, new MyPicture(), new Universal());
   }

   interface Shape { void draw(); }
   interface Marker { }
   interface Picture { void draw(); }

   class MyShape implements Marker, Shape { public void draw() { } }
   class MyPicture implements Marker, Picture { public void draw() { } }
   class Universal implements Marker, Picture, Shape { public void draw() { } }

   public static void main(String[] args) {
       new SortedInterfacesTest().secondTest();
   }
}
Comments
Basically the problem is that while JDK-8058112 handled intersection types introduced by declared bounds, inference can result in such types too which were not handled by that fix and are being addressed here. In the course of review discussions, we discovered that (Thanks Maurizio) union types run into similar bootstrap problems and the present ticket will also address that.
22-11-2017

Originally from this Stack Overflow question: https://stackoverflow.com/questions/47339331/unclear-rules-define-the-type-for-t
21-11-2017