Java, typeres: add vararg most specific tests
This commit is contained in:
@ -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());
|
||||
|
@ -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) {
|
||||
|
Reference in New Issue
Block a user