> On Aug 2, 2020, at 10:08 AM, Peter Levart <peter.lev...@gmail.com> wrote:
> 
> In either case I think it is a matter of the inline class bytecode and not 
> the code doing invocation (the call site). So it is safe by itself. Or am I 
> missing something?

You're describing Option F. Yes, we can have javac generate checks in the 
bytecode of inline class method bodies.

Some awkwardness remains whenever default methods or Object methods are 
invoked. It would be difficult and expensive to implement any checks in these 
method bodies; and while bridge methods generated in the inline class's class 
file help, they don't guard against new methods declared after compilation (the 
motivating use case for the default methods feature). So we're left with one of:

- Permit superclass/superinterface code to run, only throwing (or at least only 
guaranteeing a throw) when one of the declared instance methods of the class 
are invoked; or

- Option G: implement the checks in the JVM, where we can see the entire set of 
inherited member methods as the inline class is loaded/linked

Reply via email to