overload resolution: reject more specific inference contradicting site substitution

This commit is contained in:
Anna Kozlova
2015-08-25 16:14:03 +03:00
parent 29370f178d
commit 98408c72f6
4 changed files with 36 additions and 9 deletions

View File

@@ -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>;
}
}