Missing warning when using an instance main method

Tagir Valeev amaembo at gmail.com
Mon Sep 18 14:17:59 UTC 2023


But this code is a perfectly valid code in non-preview Java version
(unless you try to launch this class, but you don't know this during
the compilation). I don't think there should be a warning.

With best regards,
Tagir Valeev.

On Mon, Sep 18, 2023 at 9:37 AM 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


More information about the amber-dev mailing list