method references: do not prefer varargs from first search (IDEA-182018)

This commit is contained in:
Anna.Kozlova
2017-11-13 16:29:20 +01:00
parent 5758bb4185
commit e67bf2488b
3 changed files with 39 additions and 8 deletions

View File

@@ -0,0 +1,24 @@
import java.util.function.BinaryOperator;
class Test {
static class Base<T> {
Child<T> prepend(Child<T> other) {
return null;
}
}
static class Child<T> extends Base<T> {
@SafeVarargs
final Child<T> prepend(T... args) {
return this;
}
Child<T> prepend(T arg) {
return this;
}
}
public static void main(String[] args) {
BinaryOperator<Child<String>> prepend = Child::prepend;
}
}