Please reply to my JDK-8059640 issue comment

Dan Smith daniel.smith at
Wed Jul 8 23:23:41 UTC 2015

> On Jul 6, 2015, at 10:13 AM, Georgiy Rakov <georgiy.rakov at> wrote:
> Hello,
> could you please reply to my following comment <> I made to JDK-8059640; quoting it:
> Suggested spec change states that 15.13.3 will contain following assertion:
> LinkageError may occur due to inconsistencies between compile time and run time (in the referenced method, the functional interface, or the argument types of either). 
> The details are provided in parenthesis: "in the referenced method, the functional interface, or the argument types of either". It seems that these details don't extend to following case specified in jls-
> If the invocation mode is interface, then the implementation must also check that the target reference type still implements the specified interface. If the target reference type does not still implement the interface, then an IncompatibleClassChangeError occurs.
> I believe they should.
> Namely, could you please tell if you agree that spec change suggested in the issue description doesn't extend to the case specified in jls- If you agree I would appreciate greatly if you could modify the suggested spec change so that it extends to jls- case.

I think these are two different kinds of errors.

JDK-8059640 is about BootstrapMethodErrors that can occur upon *evaluation of* a method reference expression, but that aren't specified to occur.

The check you describe is an ICCE that can happen upon *invocation of* the method of an object derived from a method reference expression.

Please correct me if you're seeing different behavior, but my expectation is that the invocation will behave exactly as specified: per 15.13.3, the body of the method is via an invocation that proceeds according to; per, the ICCE can occur.


interface I { int x(); }
interface Func { int apply(I arg); }

Func f2 = I::x;
// no errors yet
System.out.println(f2.apply(new C()));
// ICCE if C was originally declared to implement I, but no longer does

So I don't think there's a bug here, either in the spec or the implementation.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the compiler-dev mailing list