method refs: correct static flag detection in case of default constructors (IDEA-92735)

This commit is contained in:
anna
2012-10-10 16:17:13 +02:00
parent 741ebbc9d1
commit 0706510a1e
2 changed files with 47 additions and 3 deletions

View File

@@ -56,3 +56,33 @@ class DefaultConstructor2 {
<error descr="Incompatible types. Found: '<method reference>', required: 'DefaultConstructor2.I'">I i2 = this::new;</error>
}
}
class DefaultConstructor3 {
public class Inner {}
public static class StaticInner {}
static <error descr="Incompatible types. Found: '<method reference>', required: 'DefaultConstructor3.I'">I i = Inner::new;</error>
static I1 i1 = StaticInner::new;
interface I {
Inner foo();
}
interface I1 {
StaticInner foo();
}
}
class DefaultConstructor4 {
public class Inner {}
public static class StaticInner {}
static I i = Inner::new;
static <error descr="Incompatible types. Found: '<method reference>', required: 'DefaultConstructor4.I1'">I1 i1 = StaticInner::new;</error>
interface I {
Inner foo(DefaultConstructor4 receiver);
}
interface I1 {
StaticInner foo(DefaultConstructor4 receiver);
}
}