<div dir="ltr"><div>Thanks for both the answers. So, to summarize: JEP 468 leaves this behavior undefined (given the JLS saying "may break"), but for now it will work as if I did things manually. Though the spec leaves open the possibility of an indy using implementation in the future.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Brian Goetz <<a href="mailto:brian.goetz@oracle.com">brian.goetz@oracle.com</a>> ezt írta (időpont: 2024. ápr. 29., H, 17:32):<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>
<div>
<font size="4" face="monospace">Gavin answered for the spec; I'll
answer now for the implementation. <br>
<br>
The current implementation will try to do an `invokespecial` of
the (int, int) constructor, which will succeed with v1 and v3, but
not v2. It will also "inline" the (int, int) record pattern
(shredding it into an instanceof test, and calls to accessors),
which, once compiled, will work against v1/v2/v3. <br>
<br>
When we get to reconstruction expressions for ordinary classes,
the pattern part will work like the constructor part today,
assuming that you declared an explicit deconstructor in v3. </font><br>
</div>
</blockquote></div></div>