We lose out on some future flexibility to add new methods, which
    might amount to nothing, or might be a big deal.


Wouldn't we just introduce the type then once we needed it? It would be awkward, but would it be impossible or inadvisable?

That would not be binary-compatible.

Let's say we had

    record Foo(int x) {}

which was translated without a supertype.  Now we later try to add in the supertype, say with a `.toJson()` method, but don't recompile Foo.  Then:

    Record r = (Record) aFoo;
    String s = r.toJson();

compiles, but throws some form of IncompatibleClassChangeError, since a Foo does not extend Record at runtime.


Reply via email to