From 2351c53dcead0474ef994a814940f1bc3c5db27c Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Mon, 16 Jun 2014 21:54:40 +0400 Subject: [PATCH] Test that Javac does not fail on two methods that differ only by return type --- .../method/ClashingSignaturesWithoutReturnType.java | 11 +++++++++++ .../method/ClashingSignaturesWithoutReturnType.kt | 6 ++++++ .../CompileJavaAgainstKotlinTestGenerated.java | 5 +++++ 3 files changed, 22 insertions(+) create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/ClashingSignaturesWithoutReturnType.java create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/ClashingSignaturesWithoutReturnType.kt diff --git a/compiler/testData/compileJavaAgainstKotlin/method/ClashingSignaturesWithoutReturnType.java b/compiler/testData/compileJavaAgainstKotlin/method/ClashingSignaturesWithoutReturnType.java new file mode 100644 index 00000000000..2c66cb88831 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/ClashingSignaturesWithoutReturnType.java @@ -0,0 +1,11 @@ +package test; + +import java.util.List; + +public class ClashingSignaturesWithoutReturnType { + void test(List ls, List li) { + K k = new K(); + k.foo(ls); + k.foo(li); + } +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/ClashingSignaturesWithoutReturnType.kt b/compiler/testData/compileJavaAgainstKotlin/method/ClashingSignaturesWithoutReturnType.kt new file mode 100644 index 00000000000..7df662ffeae --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/ClashingSignaturesWithoutReturnType.kt @@ -0,0 +1,6 @@ +package test + +class K { + fun foo(l: List): String = "" + fun foo(l: List): Int = 1 +} \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/jet/jvm/compiler/CompileJavaAgainstKotlinTestGenerated.java b/compiler/tests/org/jetbrains/jet/jvm/compiler/CompileJavaAgainstKotlinTestGenerated.java index b20ad8e53d5..cf56ae471ff 100644 --- a/compiler/tests/org/jetbrains/jet/jvm/compiler/CompileJavaAgainstKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/jvm/compiler/CompileJavaAgainstKotlinTestGenerated.java @@ -132,6 +132,11 @@ public class CompileJavaAgainstKotlinTestGenerated extends AbstractCompileJavaAg 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") public void testDefaultMethod() throws Exception { doTest("compiler/testData/compileJavaAgainstKotlin/method/DefaultMethod.kt");