Skip to content

Commit

Permalink
Adding one more testcase.
Browse files Browse the repository at this point in the history
  • Loading branch information
lahodaj committed Nov 7, 2024
1 parent 7d76959 commit 95603c9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/langtools/tools/javac/preview/PreviewTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,12 @@ private static class ImplementsPreview implements Preview {
//no error/warning (already was on Preview after implements)
public void test() {}
}
private static class ImplicitReceiver extends NonPreview {
public void g() {
test(); //implicit this - error/warning
int i = FIELD; //implicit this - error/warning
}
}
private void acceptRunnable(Runnable r) {}
private void accept(Accept<NonPreview> accept) {}
interface Accept<T> {
Expand Down Expand Up @@ -587,7 +593,9 @@ interface Produce<T> {
"Test.java:29:16: compiler.err.is.preview: preview.api.Preview",
"Test.java:32:21: compiler.err.is.preview: test()",
"Test.java:36:21: compiler.err.is.preview: test()",
"15 errors",
"Test.java:40:13: compiler.err.is.preview: test()",
"Test.java:41:21: compiler.err.is.preview: FIELD",
"17 errors",
"1 warning");

if (!log.equals(expected))
Expand Down

0 comments on commit 95603c9

Please sign in to comment.