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

Call site initialization exception caused by LambdaConversionException: Invalid receiver type

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 9
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b93
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Description

      The test case from http://mail.openjdk.java.net/pipermail/compiler-dev/2015-November/009824.html

      inlined here:

      public class Intersection {
        interface I {
        }
        interface J {
          void foo();
        }

        static <T extends I & J> void bar(T t) {
            Runnable r = t::foo;
        }
        
        public static void main(String[] args) {
          class A implements I, J { public void foo() {} }
          bar(new A());
        }
      }

      fails with

      Exception in thread "main" java.lang.BootstrapMethodError: call site initialization exception
      at java.lang.invoke.CallSite.makeSite(CallSite.java:341)
      at java.lang.invoke.MethodHandleNatives.linkCallSiteImpl(MethodHandleNatives.java:307)
      at java.lang.invoke.MethodHandleNatives.linkCallSite(MethodHandleNatives.java:297)
      at X.bar(X.java:9)
      at X.main(X.java:14)
      Caused by: java.lang.invoke.LambdaConversionException: Invalid receiver type interface X$I; not a subtype of implementation type interface X$J
      at java.lang.invoke.AbstractValidatingLambdaMetafactory.validateMetafactoryArgs(AbstractValidatingLambdaMetafactory.java:233)
      at java.lang.invoke.LambdaMetafactory.metafactory(LambdaMetafactory.java:303)
      at java.lang.invoke.CallSite.makeSite(CallSite.java:302)
      ... 4 more

        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: