method refs: check constructor refs qualifiers (IDEA-92722)

This commit is contained in:
anna
2012-10-10 16:43:24 +02:00
parent 0706510a1e
commit a927ecf5d1
4 changed files with 51 additions and 1 deletions

View File

@@ -74,3 +74,31 @@ class MyTest3<X> {
test<error descr="'test(MyTest3.I<java.lang.Integer>)' in 'MyTest3' cannot be applied to '(<method reference>)'">(MyTest3<String>::new)</error>;
}
}
class MyTestInvalidQ {
class Super {}
class ConstructorRefs extends Super {
void test() {
ConstructorRefs refs = new ConstructorRefs();
BlahBlah b0 = <error descr="Cannot find class refs">refs</error>::new;
BlahBlah blahBlah = <error descr="Cannot find class this">this</error>::new;
BlahBlah1 blahBlah1 = <error descr="Cannot find class super">super</error>::new;
}
}
interface BlahBlah {
ConstructorRefs foo();
}
interface BlahBlah1 {
Super foo();
}
abstract static class A {
interface I {
A foo();
}
<error descr="Incompatible types. Found: '<method reference>', required: 'MyTestInvalidQ.A.I'">I i = A :: new;</error>
}
}