Missing warning when using an instance main method

Holo The Sage Wolf holo3146 at gmail.com
Mon Sep 18 07:51:55 UTC 2023


Instance main method was introduced in JEP 445, this instance main method
is in principle identical to the ""top level"" main method introduced in
the same JEP (it is not really top level, but an instance method of an
unnamed class).

Why should this issued a warning?




On Mon, Sep 18, 2023, 09:37 Remi Forax <forax at univ-mlv.fr> wrote:

> Hello,
> I believe this code should emit a warning when compiled given it uses an
> instance main method
>
> class MissingWarnings {
>   void main() {
>   }
> }
>
> But the command
>   javac --enable-preview --source 21 MissingWarnings.java
> does not print a warning.
>
> regards,
> Rémi
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20230918/335ef67a/attachment.htm>


More information about the amber-dev mailing list