java.lang.Record as Interface

Remi Forax forax at univ-mlv.fr
Wed Sep 16 13:33:35 UTC 2020


----- Mail original -----
> De: "Nir Lisker" <nlisker at gmail.com>
> À: "amber-dev" <amber-dev at openjdk.java.net>
> Envoyé: Mercredi 16 Septembre 2020 12:30:06
> Objet: java.lang.Record as Interface

> Hi,

Hi,

> 
> I recall there was a discussion about making java.lang.Record an interface
> and allowing records to extend abstract classes that don't contain state.
> Was this idea dropped?

It's not exactly what was discussed and it's more a valhalla thing.
What was discussed is how to create an inline record given that an inline class can not extend an abstract class,
so the current solution is to allow inline class to extends an abstract class if the class has no field.
(Dan Smith as a spec proposal on valhalla-spec mailing list)

What you are proposing is to have multiple super classes, which is a big no no because having more than one super class is a major breaking change.

> 
> - Nir

Rémi


More information about the amber-dev mailing list