mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
Local records support (IDEA-228460)
GitOrigin-RevId: 6bd11c1161f4773570573910d88c7a395f972e3c
This commit is contained in:
committed by
intellij-monorepo-bot
parent
bc5e69a390
commit
ee428f70e6
+27
@@ -0,0 +1,27 @@
|
||||
class Foo {
|
||||
void test() {
|
||||
record NoComponent() {}
|
||||
|
||||
static record DeclaredStatic() {}
|
||||
}
|
||||
|
||||
static int STATIC_VAR = 3;
|
||||
|
||||
int instanceVar;
|
||||
|
||||
void capture() {
|
||||
int outerLocal = 2;
|
||||
final int compileTimeConstant = 3;
|
||||
record Local() {
|
||||
static int X = 2;
|
||||
|
||||
void test() {
|
||||
System.out.println(STATIC_VAR);
|
||||
System.out.println(<error descr="Non-static field 'instanceVar' cannot be referenced from a static context">instanceVar</error>);
|
||||
System.out.println(<error descr="Non-static variable 'outerLocal' cannot be referenced from a static context">outerLocal</error>);
|
||||
System.out.println(X);
|
||||
System.out.println(compileTimeConstant);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user