overload resolution: N parameters of varargs target should be less than N parameters of corresponding interface (IDEA-257526)

GitOrigin-RevId: 811135c478f3f98fa1923f4b58c27d6ca0144939
This commit is contained in:
Anna Kozlova
2020-12-15 21:07:17 +01:00
committed by intellij-monorepo-bot
parent 118dda6470
commit 7d0ce7b928
3 changed files with 72 additions and 5 deletions

View File

@@ -0,0 +1,60 @@
interface I {
void foo(String s, Object... params);
}
class Foo {
void n(I i) {}
void n(Runnable r) {}
void fooBar(String s, Object... params) {}
{
n(this::fooBar);
}
}
class Foo1 {
void n(I i) {}
void n(Runnable r) {}
static void fooBar(String s, Object... params) {}
{
n(Foo1::fooBar);
}
}
interface I2 {
void foo(Foo2 s, Object... params);
}
class Foo2 {
void n(I2 i) {}
void n(Runnable r) {}
void fooBar(Object... params) {}
{
n(Foo2::fooBar);
}
void fooBar1(Object o, Object... params) {}
{
n(Foo2::fooBar1);
}
}
class Foo3 {
interface I3 {
void foo(Foo3 s, Object... params);
}
interface I4 {
void foo(Object params);
}
void n(I3 i) {}
void n(I4 r) {}
void fooBar(Object o, Object... params) {}
{
n(Foo3::fooBar);
}
}