Inline Record
Srikanth
srikanth.adayapalam at oracle.com
Thu May 7 00:14:04 UTC 2020
Thanks for the report Remi, I have raised
https://bugs.openjdk.java.net/browse/JDK-8244560
Srikanth
On 07/05/20 3:43 am, Remi Forax wrote:
> records adds equals/hashCode/toString and inline adds equals/hashCode/toString,
> so what an inline record does ?
> @__inline__ record Foo(int x) {}
>
> answer, you get all methods twice.
>
> javac --enable-preview --source 15 Hello.java
> Hello.java:2: error: method hashCode() is already defined in record Foo
> @__inline__ record Foo(int x) {}
> ^
> In my opinion, records and inline should use the same BSM, so if an inline is already a record, no need to add the methods again.
>
> regards,
> Rémi
More information about the amber-dev
mailing list