Test that Javac does not fail on two methods that differ only by return type
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
|||||||
|
package test;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class ClashingSignaturesWithoutReturnType {
|
||||||
|
void test(List<String> ls, List<Integer> li) {
|
||||||
|
K k = new K();
|
||||||
|
k.foo(ls);
|
||||||
|
k.foo(li);
|
||||||
|
}
|
||||||
|
}
|
||||||
+6
@@ -0,0 +1,6 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
class K {
|
||||||
|
fun foo(l: List<String>): String = ""
|
||||||
|
fun foo(l: List<Int>): Int = 1
|
||||||
|
}
|
||||||
+5
@@ -132,6 +132,11 @@ public class CompileJavaAgainstKotlinTestGenerated extends AbstractCompileJavaAg
|
|||||||
doTest("compiler/testData/compileJavaAgainstKotlin/method/ArrayOfIntegerArray.kt");
|
doTest("compiler/testData/compileJavaAgainstKotlin/method/ArrayOfIntegerArray.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("ClashingSignaturesWithoutReturnType.kt")
|
||||||
|
public void testClashingSignaturesWithoutReturnType() throws Exception {
|
||||||
|
doTest("compiler/testData/compileJavaAgainstKotlin/method/ClashingSignaturesWithoutReturnType.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("DefaultMethod.kt")
|
@TestMetadata("DefaultMethod.kt")
|
||||||
public void testDefaultMethod() throws Exception {
|
public void testDefaultMethod() throws Exception {
|
||||||
doTest("compiler/testData/compileJavaAgainstKotlin/method/DefaultMethod.kt");
|
doTest("compiler/testData/compileJavaAgainstKotlin/method/DefaultMethod.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user