Compact Record Constructors

Jordan Zimmerman jordan at jordanzimmerman.com
Mon Nov 11 13:57:58 UTC 2019


Excuse a comment from the peanut gallery - we already have class initializers so why are "Compact Record Constructors" even needed? Wouldn't a non-static class initializer do the same thing? E.g.

record Pair(String name, int value) {
    {
        Objects.requireNonNull(name);
    }
}



More information about the amber-spec-observers mailing list