method refs: when no acceptable methods found force conflicts to be empty; raw refs corrected; check for static should be performed over inner class in case of constructors

This commit is contained in:
anna
2012-10-02 14:11:03 +02:00
parent 2e4e46f2ab
commit b043a24ebf
2 changed files with 61 additions and 9 deletions

View File

@@ -73,4 +73,46 @@ class StaticInner1 {
static {
call3<error descr="Ambiguous method call: both 'StaticInner1.call3(I1)' and 'StaticInner1.call3(I2)' match">(StaticInner1.Inner :: new)</error>;
}
}
class StaticInner2 {
static class Inner {
Inner() {}
}
interface I1 {
Inner m(StaticInner2 rec);
}
static {
<error descr="Incompatible types. Found: '<method reference>', required: 'StaticInner2.I1'">I1 i1 = StaticInner2.Inner :: new;</error>
}
{
<error descr="Incompatible types. Found: '<method reference>', required: 'StaticInner2.I1'">I1 i1 = StaticInner2.Inner :: new;</error>
}
}
class NonStaticInner2 {
class Inner {
Inner() {}
}
interface I1 {
Inner m(NonStaticInner2 rec);
}
static {
I1 i1 = NonStaticInner2.Inner :: new;
}
{
I1 i1 = NonStaticInner2.Inner :: new;
}
}