new inference: reject varargs as method reference target

(cherry picked from commit 77017d7790b78c5bb20c591e2588c1eccd0f96d7)
This commit is contained in:
Anna Kozlova
2014-03-10 14:18:03 +01:00
parent 0f40eb9bed
commit fb20169d40
3 changed files with 25 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
class Test {
interface IntMapper {
int map();
}
interface LongMapper {
long map();
}
void m(IntMapper im1, IntMapper... im) { }
void m(LongMapper... lm) { }
{
m<error descr="Ambiguous method call: both 'Test.m(IntMapper, IntMapper...)' and 'Test.m(LongMapper...)' match">(this ::ii)</error>;
}
int ii() {return 0;}
}