RFR: 8194743: Compiler implementation for Statements before super() [v16]

Maurizio Cimadamore mcimadamore at openjdk.org
Mon Sep 25 17:56:25 UTC 2023


On Mon, 25 Sep 2023 17:48:33 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties line 238:
>> 
>>> 236: # 0: name
>>> 237: compiler.err.call.must.only.appear.in.ctor=\
>>> 238:     calls to {0}() may only appear within constructors
>> 
>> Note that super()/this() in the JLS lingo is called "explicit constructor invocation".
>
> @GavinBierman do you think the compiler message should mention the official JLS terminology?

For instance:


explicit constructor invocation may only appear within constructors



redundant explicit constructor invocation



explicit constructor invocation not allowed here



'return'' not allowed before explicit constructor invocation

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/13656#discussion_r1336216414


More information about the kulla-dev mailing list