[java-highlighting] IDEA-270163 Good code is red: private record declared in anonymous class

GitOrigin-RevId: fd0e72648b09de6efcac2749d2e4c9e8c99542d5
This commit is contained in:
Tagir Valeev
2022-12-13 16:12:25 +01:00
committed by intellij-monorepo-bot
parent 6328482822
commit 8653f21eef
4 changed files with 27 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
//statics in inner -- in Java 16 allowed everywhere
public class a {
<error descr="Class 'a' is public, should be declared in a file named 'a.java'">public class a</error> {
static final Number x = null;
static final int ix = x== null ? 4 : 3;
@@ -83,7 +83,7 @@ public class a {
void withanonymous() {
new Object() {
<error descr="Modifier 'private' not allowed here">private</error> class RT {}
private class RT {}
private void method() {}
private int myI;
};