Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8191655

LambdaConversionException: Invalid receiver type interface; not a subtype of implementation type interface

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 10
    • Component/s: tools
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b33
    • CPU:
      generic
    • OS:
      generic

      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();
         }
      }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sadayapalam Srikanth Adayapalam
                Reporter:
                sadayapalam Srikanth Adayapalam
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: