most specific: infer specific if method is generic even if type arguments are explicitly provided

This commit is contained in:
Anna Kozlova
2015-02-13 16:30:40 +01:00
parent 925e9d1610
commit 465879cacf
3 changed files with 18 additions and 1 deletions

View File

@@ -0,0 +1,13 @@
class Test<T> {
Test(T arg) {}
Test(String arg) {}
static <X> Test<X> m(X arg) {return null;}
static <X> Test<X> m(String arg) {return null;}
{
m("");
Test.<String>m("");
new Test<>("");
new Test<String><error descr="Cannot resolve constructor 'Test(java.lang.String)'">("")</error>;
}
}