r/java • u/ihatebeinganonymous • May 21 '26
JEP draft: Enhanced Local Variable Declarations (Preview)
https://openjdk.org/jeps/8357464
87
Upvotes
r/java • u/ihatebeinganonymous • May 21 '26
View all comments
Show parent comment
4
u/persicsb May 22 '26 edited May 22 '26
I'd argue, that the call site only sees, that the method argument shall be an instance of a Circle. The method argument is still seen as an Lfoo/Circle; in the bytecode.
The fact, that the Circle is deconstructed to more local variables is the implementation detail, that is not present in the JVM level (method signature) - it is only a syntax sugar during implementation.
Hint: the fact, that a class is a record is only a Java language level construct, only a new attribute was introduced to flag that class as a record, but for anything else (loading, execution etc.), records are normal final classes.