Java, typeres: add vararg most specific tests

This commit is contained in:
Bendegúz Nagy
2017-07-08 20:22:35 +02:00
parent 865f86599f
commit 12a16caf69
2 changed files with 13 additions and 1 deletions

View File

@ -1325,6 +1325,10 @@ public class ClassTypeResolverTest {
assertEquals(int.class, expressions.get(index).getType());
assertEquals(int.class, getChildType(expressions.get(index), 0));
assertEquals(int.class, getChildType(expressions.get(index++), 1));
// String d = mostSpecific(10, 10, 10);
assertEquals(String.class, expressions.get(index).getType());
assertEquals(String.class, getChildType(expressions.get(index), 0));
assertEquals(String.class, getChildType(expressions.get(index++), 1));
// Make sure we got them all
assertEquals("All expressions not tested", index, expressions.size());

View File

@ -15,8 +15,16 @@ public class MethodThirdPhase {
// component type determined properly
int c = vararg(10, "", "", "");
// TODO: add most specific tests among vararg conversion
// most specific vararg method
String d = mostSpecific(10, 10, 10);
}
Exception mostSpecific(Number... b) {
return null;
}
String mostSpecific(Integer... b) {
return null;
}
Exception vararg(int a, Number... b) {