From 12ceaf24e2adb7ed125118802f6df0fa8594036b Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Thu, 16 Apr 2020 11:40:04 +0300 Subject: [PATCH] FIR: Adjust testData for spec tests: resolution ambiguity Renaming AMBIGUITY -> OVERLOAD_RESOLUTION_AMBIGUITY may help ^KT-38342 Submitted --- .../p-5/neg/2.3.fir.kt | 59 +++++++++++ .../p-5/neg/2.4.fir.kt | 98 +++++++++++++++++++ .../p-5/neg/2.5.fir.kt | 54 ++++++++++ 3 files changed, 211 insertions(+) create mode 100644 compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.3.fir.kt create mode 100644 compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.4.fir.kt create mode 100644 compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.5.fir.kt diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.3.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.3.fir.kt new file mode 100644 index 00000000000..fd95c77e2a0 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.3.fir.kt @@ -0,0 +1,59 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION -NOTHING_TO_INLINE +// SKIP_TXT + +/* + * KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE) + * + * SPEC VERSION: 0.1-278 + * PLACE: overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 5 -> sentence 2 + * RELEVANT PLACES: overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 4 -> sentence 1 + * overload-resolution, building-the-overload-candidate-set-ocs, call-with-an-explicit-receiver -> paragraph 6 -> sentence 3 + * overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 8 -> sentence 1 + * overload-resolution, building-the-overload-candidate-set-ocs, call-with-specified-type-parameters -> paragraph 1 -> sentence 2 + * NUMBER: 3 + * DESCRIPTION: The overload candidate sets for each pair of implicit receivers: Explicitly imported extension callables + */ + + +// FILE: Lib.kt +package libPackageCase1 +import testsCase1.* + +public fun emptyArray(): Array = TODO() +fun Case1.emptyArray(): Array = TODO() + +// FILE: Lib.kt +package libPackageCase1Explicit +import testsCase1.* + +fun Case1.emptyArray(): Array = TODO() + +public fun emptyArray(): Array = TODO() +// FILE: Lib.kt +package libPackageCase1ExplicitDuplicate +import testsCase1.* + +fun Case1.emptyArray(): Array = TODO() + +public fun emptyArray(): Array = TODO() + +// FILE: LibtestsPack.kt +package testsCase1 +fun Case1.emptyArray(): Array = TODO() + +public fun emptyArray(): Array = TODO() + +// FILE: TestCase.kt +package testsCase1 +import libPackageCase1.* +import libPackageCase1Explicit.emptyArray +import libPackageCase1ExplicitDuplicate.emptyArray + +// TESTCASE NUMBER: 1 +class Case1(){ + + fun case1() { + emptyArray() + } +} diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.4.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.4.fir.kt new file mode 100644 index 00000000000..c53adee97d5 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.4.fir.kt @@ -0,0 +1,98 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION -NOTHING_TO_INLINE +// SKIP_TXT + +/* + * KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE) + * + * SPEC VERSION: 0.1-278 + * PLACE: overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 5 -> sentence 2 + * RELEVANT PLACES: overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 4 -> sentence 1 + * overload-resolution, building-the-overload-candidate-set-ocs, call-with-an-explicit-receiver -> paragraph 6 -> sentence 4 + * overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 8 -> sentence 1 + * overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 6 -> sentence 1 + * overload-resolution, building-the-overload-candidate-set-ocs, call-with-specified-type-parameters -> paragraph 1 -> sentence 2 + * NUMBER: 4 + * DESCRIPTION: The overload candidate sets for each pair of implicit receivers: declared in the package scope extension callables + */ + + + +// FILE: TestCase.kt +// TESTCASE NUMBER: 1 +package testsCase1 +import libPackageCase1.* +import libPackageCase1Explicit.emptyArray + +fun Case1.emptyArray(): Array = TODO() + +class Case1(){ + + fun case1() { + emptyArray() + } +} + + +// FILE: Lib.kt +package libPackageCase1 +import testsCase1.* + +public fun emptyArray(): Array = TODO() +fun Case1.emptyArray(): Array = TODO() + +// FILE: Lib.kt +package libPackageCase1Explicit + +public fun emptyArray(): Array = TODO() + +// FILE: LibtestsPack.kt +// TESTCASE NUMBER: 1 +package testsCase1 +fun Case1.emptyArray(): Array = TODO() + +public fun emptyArray(): Array = TODO() + + + + +// FILE: TestCase.kt +// TESTCASE NUMBER: 2 +package testsCase2 +import libPackageCase2.* +import libPackageCase2Explicit.emptyArray + +fun Case2.emptyArray(): Array = TODO() + +class Case2(){ + + fun case1() { + emptyArray() + } +} + +val Case2.emptyArray: A + get() = A() + +class A { + operator fun invoke(): Unit = TODO() +} + +// FILE: Lib.kt +package libPackageCase2 +import testsCase2.* + +public fun emptyArray(): Array = TODO() +fun Case2.emptyArray(): Array = TODO() + +// FILE: Lib.kt +package libPackageCase2Explicit + +public fun emptyArray(): Array = TODO() + +// FILE: LibtestsPack.kt +// TESTCASE NUMBER: 2 +package testsCase2 +fun Case2.emptyArray(): Array = TODO() + +public fun emptyArray(): Array = TODO() diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.5.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.5.fir.kt new file mode 100644 index 00000000000..7d916d0840f --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.5.fir.kt @@ -0,0 +1,54 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION -NOTHING_TO_INLINE +// SKIP_TXT + +/* + * KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE) + * + * SPEC VERSION: 0.1-278 + * PLACE: overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 5 -> sentence 2 + * RELEVANT PLACES: overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 4 -> sentence 1 + * overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 8 -> sentence 1 + * overload-resolution, building-the-overload-candidate-set-ocs, call-with-an-explicit-receiver -> paragraph 6 -> sentence 5 + * overload-resolution, building-the-overload-candidate-set-ocs, call-with-specified-type-parameters -> paragraph 1 -> sentence 2 + * NUMBER: 5 + * DESCRIPTION: The overload candidate sets for each pair of implicit receivers: Implicitly imported extension callables + */ + + +// FILE: Lib.kt +package libPackageCase1 +import testsCase1.* + +public fun emptyArray(): Array = TODO() +fun Case1.emptyArray(): Array = TODO() +// FILE: Lib.kt +package libPackageCase1Duplicate +import testsCase1.* + +public fun emptyArray(): Array = TODO() +fun Case1.emptyArray(): Array = TODO() + +// FILE: Lib.kt +package libPackageCase1Explicit + +public fun emptyArray(): Array = TODO() + +// FILE: LibtestsPack.kt +package testsCase1 + +public fun emptyArray(): Array = TODO() + +// FILE: TestCase.kt +package testsCase1 +import libPackageCase1.* +import libPackageCase1Duplicate.* +import libPackageCase1Explicit.emptyArray + +// TESTCASE NUMBER: 1 +class Case1(){ + + fun case1() { + emptyArray() + } +}