overload resolution: reject more specific inference contradicting site substitution

This commit is contained in:
Anna Kozlova
2015-08-26 12:08:47 +03:00
parent 29370f178d
commit 98408c72f6
4 changed files with 36 additions and 9 deletions
@@ -0,0 +1,10 @@
class Test {
interface One<T> {
<S extends T> S save(S entity);
<S extends T> Iterable<S> save(Iterable<S> entities);
}
static One<String> foo;
public static void main(String[] args) throws Exception {
foo.save <error descr="Ambiguous method call: both 'One.save(String)' and 'One.save(Iterable<String>)' match">(null)</error>;
}
}