diff --git a/compiler/testData/cli/jvm/conflictingOverloads.args b/compiler/testData/cli/jvm/conflictingOverloads.args new file mode 100644 index 00000000000..aab851ab01f --- /dev/null +++ b/compiler/testData/cli/jvm/conflictingOverloads.args @@ -0,0 +1,4 @@ +-src +$TESTDATA_DIR$/conflictingOverloads.kt +-output +$TEMP_DIR$ \ No newline at end of file diff --git a/compiler/testData/cli/jvm/conflictingOverloads.kt b/compiler/testData/cli/jvm/conflictingOverloads.kt new file mode 100644 index 00000000000..44a6630d922 --- /dev/null +++ b/compiler/testData/cli/jvm/conflictingOverloads.kt @@ -0,0 +1,2 @@ +fun a(): List = null!! +fun a(): List = null!! \ No newline at end of file diff --git a/compiler/testData/cli/jvm/conflictingOverloads.out b/compiler/testData/cli/jvm/conflictingOverloads.out new file mode 100644 index 00000000000..c48cc2270f0 --- /dev/null +++ b/compiler/testData/cli/jvm/conflictingOverloads.out @@ -0,0 +1,3 @@ +ERROR: $TESTDATA_DIR$/conflictingOverloads.kt: (1, 1) 'internal fun a(): kotlin.List' is already defined in root package +ERROR: $TESTDATA_DIR$/conflictingOverloads.kt: (2, 1) 'internal fun a(): kotlin.List' is already defined in root package +COMPILATION_ERROR \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/jet/cli/KotlincExecutableTestGenerated.java b/compiler/tests/org/jetbrains/jet/cli/KotlincExecutableTestGenerated.java index 67c69e4c55c..870af9a1ab3 100644 --- a/compiler/tests/org/jetbrains/jet/cli/KotlincExecutableTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/cli/KotlincExecutableTestGenerated.java @@ -44,6 +44,11 @@ public class KotlincExecutableTestGenerated extends AbstractKotlincExecutableTes doJvmTest("compiler/testData/cli/jvm/classpath.args"); } + @TestMetadata("conflictingOverloads.args") + public void testConflictingOverloads() throws Exception { + doJvmTest("compiler/testData/cli/jvm/conflictingOverloads.args"); + } + @TestMetadata("diagnosticsOrder.args") public void testDiagnosticsOrder() throws Exception { doJvmTest("compiler/testData/cli/jvm/diagnosticsOrder.args"); diff --git a/compiler/tests/org/jetbrains/jet/cli/jvm/K2JvmCliTest.java b/compiler/tests/org/jetbrains/jet/cli/jvm/K2JvmCliTest.java index f0c403940d7..58c46e50bb1 100644 --- a/compiler/tests/org/jetbrains/jet/cli/jvm/K2JvmCliTest.java +++ b/compiler/tests/org/jetbrains/jet/cli/jvm/K2JvmCliTest.java @@ -61,4 +61,9 @@ public class K2JvmCliTest extends CliBaseTest { public void signatureClash() throws Exception { executeCompilerCompareOutputJVM(); } + + @Test + public void conflictingOverloads() throws Exception { + executeCompilerCompareOutputJVM(); + } }