mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-07 05:09:37 +07:00
method refs: compilation error when static method is accept through instance reference
This commit is contained in:
@@ -30,7 +30,7 @@ class AlienTest {
|
||||
<error descr="Incompatible types. Found: '<method reference>', required: 'AlienTest.IInt'">IInt i3 = MyTest::bar;</error>
|
||||
<error descr="Incompatible types. Found: '<method reference>', required: 'AlienTest.IIntInt'">IIntInt i4 = MyTest::bar;</error>
|
||||
<error descr="Incompatible types. Found: '<method reference>', required: 'AlienTest.IInt'">IInt i5 = MyTest::baz;</error>
|
||||
IInt i6 = <error descr="'foo(int)' is not public in 'MyTest.Foo'. Cannot be accessed from outside package">MyTest.foo::foo</error>;
|
||||
<error descr="Incompatible types. Found: '<method reference>', required: 'AlienTest.IInt'">IInt i6 = MyTest.foo::foo;</error>
|
||||
IInt i7 = MyTest.<error descr="'MyTest.Foo' has private access in 'MyTest'">Foo</error>::foo;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ class MyTest3 {
|
||||
static void m() { }
|
||||
|
||||
public static void main(String[] args) {
|
||||
I s = new MyTest3()::m;
|
||||
<error descr="Incompatible types. Found: '<method reference>', required: 'MyTest3.I'">I s = new MyTest3()::m;</error>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
class Test<X> {
|
||||
|
||||
interface I {
|
||||
void _();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void test() {
|
||||
<error descr="Incompatible types. Found: '<method reference>', required: 'Test.I'">I i1 = Test<String>::foo;</error>
|
||||
I i2 = Test::foo;
|
||||
}
|
||||
|
||||
static void foo() { };
|
||||
}
|
||||
@@ -7,8 +7,8 @@ class Test<T> {
|
||||
Test test = new Test<String>();
|
||||
BlahBlah<String> blahBlah = test::<String>foo;
|
||||
BlahBlah<String> blahBlah1 = test::<String>foo1;
|
||||
BlahBlah<String> blahBlah2 = test::<String>foo2;
|
||||
BlahBlah<String> blahBlah3 = test::<String>foo3;
|
||||
<error descr="Incompatible types. Found: '<method reference>', required: 'BlahBlah<java.lang.String>'">BlahBlah<String> blahBlah2 = test::<String>foo2;</error>
|
||||
<error descr="Incompatible types. Found: '<method reference>', required: 'BlahBlah<java.lang.String>'">BlahBlah<String> blahBlah3 = test::<String>foo3;</error>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user