JDK-8142476 : Call site initialization exception caused by LambdaConversionException: Invalid receiver type
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2015-11-11
  • Updated: 2023-07-24
  • Resolved: 2015-11-12
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 9
9 b93Fixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Relates :  
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


Comments
URL: http://hg.openjdk.java.net/jdk9/jdk9/langtools/rev/582f31e79d74 User: lana Date: 2015-11-18 23:52:52 +0000
18-11-2015

URL: http://hg.openjdk.java.net/jdk9/dev/langtools/rev/582f31e79d74 User: sadayapalam Date: 2015-11-12 00:29:59 +0000
12-11-2015