mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
instance inner class accessed from static context in declaration: error if containing class contains type params, good code otherwise
This commit is contained in:
+50
@@ -0,0 +1,50 @@
|
||||
class MyTest<K> {
|
||||
|
||||
class A<T> {
|
||||
}
|
||||
|
||||
//not an error in java 8?!
|
||||
static class C<T extends <error descr="'MyTest.this' cannot be referenced from a static context">A<String></error>> {
|
||||
}
|
||||
|
||||
static <T extends <error descr="'MyTest.this' cannot be referenced from a static context">A<String></error>> void bar() {
|
||||
}
|
||||
|
||||
static class B {
|
||||
{
|
||||
B.<<error descr="'MyTest.this' cannot be referenced from a static context">A</error>>bar();
|
||||
<error descr="'MyTest.this' cannot be referenced from a static context">A</error> a;
|
||||
}
|
||||
|
||||
static <T extends <error descr="'MyTest.this' cannot be referenced from a static context">A<String></error>> void bar() {
|
||||
}
|
||||
|
||||
void v(C<<error descr="'MyTest.this' cannot be referenced from a static context">A<String></error>> c) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class MyTest1 {
|
||||
|
||||
class A<T> {
|
||||
}
|
||||
|
||||
static class C<T extends A<String>> {
|
||||
}
|
||||
|
||||
static <T extends A<String>> void bar() {
|
||||
}
|
||||
|
||||
static class B {
|
||||
{
|
||||
B.<A>bar();
|
||||
A a = <error descr="'MyTest1.this' cannot be referenced from a static context">new A()</error>;
|
||||
}
|
||||
|
||||
static <T extends A<String>> void bar() {
|
||||
}
|
||||
|
||||
void v(C<A<String>> c) {
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user