mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
overload resolution with varargs: don't prefer promitive varargs when no arg is provided (IDEA-140759)
This commit is contained in:
+10
@@ -0,0 +1,10 @@
|
||||
|
||||
class Test {
|
||||
public void test(String... <warning descr="Parameter 'a' is never used">a</warning>){}
|
||||
|
||||
public void test(int... <warning descr="Parameter 'a' is never used">a</warning>){}
|
||||
|
||||
public static void main(String[] args) {
|
||||
new Test().test<error descr="Ambiguous method call: both 'Test.test(String...)' and 'Test.test(int...)' match">()</error>;
|
||||
}
|
||||
}
|
||||
+4
@@ -118,6 +118,10 @@ public class OverloadResolutionTest extends LightDaemonAnalyzerTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testPrimitiveVarargsAreNoMoreSpecificThanNonPrimitiveWhenNoArgIsActuallyProvided() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user