method refs: do not choose more specific method between methods with different number of params

(cherry picked from commit f986c7c3541f032da16736f43fd34c92337242c4)
This commit is contained in:
anna
2013-11-27 21:05:02 +01:00
parent 41f4842a50
commit f2c576c7de
3 changed files with 14 additions and 5 deletions

View File

@@ -6,7 +6,7 @@ interface Func<TIn, TOut>{
class Main {
public static void main(final String[] args) {
Func<Integer, String> func = Integer::toString;
<error descr="Incompatible types. Found: '<method reference>', required: 'Func<java.lang.Integer,java.lang.String>'">Func<Integer, String> func = Integer::toString;</error>
System.out.println(func.run(6));
}
}