-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
8291154: Create a non static nested class without enclosing class thr…
…ows VerifyError Backport-of: f96aee74010476a850175f7012c196e40a31c188
- Loading branch information
Showing
3 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
test/langtools/tools/javac/nested/StaticNestedNonStaticSuper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* @test /nodynamiccopyright/ | ||
* @bug 8291154 | ||
* @summary Disallow static nested subclasses of non-static nested classes | ||
* @compile/fail/ref=StaticNestedNonStaticSuper.out -XDrawDiagnostics StaticNestedNonStaticSuper.java | ||
*/ | ||
|
||
class StaticNestedNonStaticSuper{ | ||
public abstract class NonStaticNested { | ||
public static class StaticNested extends NonStaticNested { | ||
} | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
test/langtools/tools/javac/nested/StaticNestedNonStaticSuper.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
StaticNestedNonStaticSuper.java:10:23: compiler.err.no.encl.instance.of.type.in.scope: StaticNestedNonStaticSuper | ||
1 error |
6414676
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review
Issues