Loosening requirements for super() invocation

Archie Cobbs archie.cobbs at gmail.com
Wed Jan 25 23:06:31 UTC 2023


On Wed, Jan 25, 2023 at 3:57 PM Brian Goetz <brian.goetz at oracle.com> wrote:

>
> I didn't realize that the restriction that super()/this() must be first in
> a constructor was actually implemented using the language grammar.
>
> But it doesn't have to be that way, does it? I mean, the grammar allows
> "foobar()" to appear in any method, even when "foobar()" cannot be
> resolved. The requirement for "foobar()" to be resolvable is stated
> elsewhere, outside of the grammar.
>
>
> Justifying a feature like this is based on costs, risks, benefits, and
> priorities.  A feature with lower cost or risk is easier to justify.  Doing
> a 40% smaller feature (just going by your "3 out of 5" estimate) at 95%
> lower cost (making up a number here, but the difference appears
> significant) seems worth considering carefully.
>

Gotcha. I think I need to spend time getting more familiar with the spec,
so I can better understand how it's put together, what the trade-offs are,
etc.

Thanks,
-Archie

-- 
Archie L. Cobbs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20230125/e8e19d16/attachment.htm>


More information about the amber-dev mailing list