8315458: Implement JEP 463: Implicitly Declared Classes and Instance Main Method (Second Preview)

Reviewed-by: jlahoda, mcimadamore, vromero, rriggs, alanb, mchung
This commit is contained in:
Jim Laskey 2023-11-30 12:49:49 +00:00
parent 03759e892d
commit 04ad98ed32
48 changed files with 612 additions and 664 deletions

View file

@ -564,7 +564,7 @@ public class SourceLauncherTest extends TestRunner {
tb.writeJavaFiles(base,
"class NotStatic { public void main(String... args) { } }");
testError(base.resolve("NotStatic.java"), "",
"error: 'main' method is not declared 'public static'");
"error: can't find main(String[]) method in class: NotStatic");
}
@Test
@ -572,7 +572,7 @@ public class SourceLauncherTest extends TestRunner {
tb.writeJavaFiles(base,
"class NotVoid { public static int main(String... args) { return 0; } }");
testError(base.resolve("NotVoid.java"), "",
"error: 'main' method is not declared with a return type of 'void'");
"error: can't find main(String[]) method in class: NotVoid");
}
@Test