mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8332236: javac crashes with module imports and implicitly declared class
Reviewed-by: vromero
This commit is contained in:
parent
4e77cf881d
commit
d04ac14bdb
2 changed files with 24 additions and 2 deletions
|
@ -23,7 +23,7 @@
|
|||
|
||||
/**
|
||||
* @test
|
||||
* @bug 8328481
|
||||
* @bug 8328481 8332236
|
||||
* @summary Check behavior of module imports.
|
||||
* @library /tools/lib
|
||||
* @modules java.logging
|
||||
|
@ -719,4 +719,26 @@ public class ImportModule extends TestRunner {
|
|||
.writeAll();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testImplicitlyDeclaredClass(Path base) throws Exception {
|
||||
Path current = base.resolve(".");
|
||||
Path src = current.resolve("src");
|
||||
Path classes = current.resolve("classes");
|
||||
tb.writeFile(src.resolve("Test.java"),
|
||||
"""
|
||||
import module java.base;
|
||||
void main() {
|
||||
}
|
||||
""");
|
||||
|
||||
Files.createDirectories(classes);
|
||||
|
||||
new JavacTask(tb)
|
||||
.options("--enable-preview", "--release", SOURCE_VERSION)
|
||||
.outdir(classes)
|
||||
.files(tb.findJavaFiles(src))
|
||||
.run(Task.Expect.SUCCESS)
|
||||
.writeAll();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue