diff --git a/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/p-5/pos/3.1.kt b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/p-5/pos/3.1.kt index 895d5b2d084..3c3a2cdc9f0 100644 --- a/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/p-5/pos/3.1.kt +++ b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/p-5/pos/3.1.kt @@ -3,31 +3,31 @@ /* * KOTLIN CODEGEN BOX SPEC TEST (POSITIVE) * - * SPEC VERSION: 0.1-268 - * PLACE:overload-resolution, receivers -> paragraph 5 -> sentence 3 + * SPEC VERSION: 0.1-278 + * PLACE: overload-resolution, receivers -> paragraph 5 -> sentence 3 * NUMBER: 1 - * DESCRIPTION: Current class companion object receiver has higher priority than any of the superclass companion objects; + * DESCRIPTION: The phantom static implicit this receiver has higher priority than the current class companion object receiver; */ -class Case() : CaseBase() { - - companion object foo{ - var isCaseCompanionCalled = false - fun foo(){isCaseCompanionCalled = true} - } -} - -open class CaseBase { - companion object foo { - var isCaseBaseReceiverCalled = false - fun foo() { this.isCaseBaseReceiverCalled = true } -// operator fun invoke() {} - } -} +var flag = false fun box(): String { - Case.foo.foo() - if (!CaseBase.isCaseBaseReceiverCalled && Case.isCaseCompanionCalled) + Case1.A1.foo() + if (!flag) return "OK" return "NOK" } + +enum class Case1 { + A1, A2; + + companion object values { + operator fun invoke() { + flag = true + } + } + + fun foo() { + values() + } +} diff --git a/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/p-5/pos/3.2.kt b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/p-5/pos/4.2.kt similarity index 96% rename from compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/p-5/pos/3.2.kt rename to compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/p-5/pos/4.2.kt index 52b5fb99fd3..2524f6127a0 100644 --- a/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/p-5/pos/3.2.kt +++ b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/p-5/pos/4.2.kt @@ -3,8 +3,8 @@ /* * KOTLIN CODEGEN BOX SPEC TEST (POSITIVE) * - * SPEC VERSION: 0.1-268 - * PLACE:overload-resolution, receivers -> paragraph 5 -> sentence 3 + * SPEC VERSION: 0.1-278 + * PLACE:overload-resolution, receivers -> paragraph 5 -> sentence 4 * NUMBER: 2 * DESCRIPTION: Current class companion object receiver has higher priority than any of the superclass companion objects; */ diff --git a/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/p-5/pos/4.1.kt b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/p-5/pos/5.1.kt similarity index 97% rename from compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/p-5/pos/4.1.kt rename to compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/p-5/pos/5.1.kt index 0797920d79e..5e87b227785 100644 --- a/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/p-5/pos/4.1.kt +++ b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/p-5/pos/5.1.kt @@ -3,9 +3,9 @@ /* * KOTLIN CODEGEN BOX SPEC TEST (POSITIVE) * - * SPEC VERSION: 0.1-268 - * PLACE: overload-resolution, receivers -> paragraph 5 -> sentence 4 - * RELEVANT PLACES: overload-resolution, receivers -> paragraph 5 -> sentence 3 + * SPEC VERSION: 0.1-278 + * PLACE: overload-resolution, receivers -> paragraph 5 -> sentence 5 + * RELEVANT PLACES: overload-resolution, receivers -> paragraph 5 -> sentence 4 * NUMBER: 1 * DESCRIPTION: Superclass companion object receivers are prioritized according to the inheritance order */ diff --git a/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/testsMap.json b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/testsMap.json index 7e22b25590d..9d8a11b9019 100644 --- a/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/testsMap.json +++ b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/testsMap.json @@ -17,30 +17,32 @@ ], "3": [ { - "specVersion": "0.1-268", + "specVersion": "0.1-278", "casesNumber": 0, - "description": "Current class companion object receiver has higher priority than any of the superclass companion objects;", + "description": "The phantom static implicit this receiver has higher priority than the current class companion object receiver;", "unexpectedBehaviour": false - }, + } + ], + "5": [ { - "specVersion": "0.1-268", + "specVersion": "0.1-278", "casesNumber": 0, "description": "Superclass companion object receivers are prioritized according to the inheritance order", - "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/p-5/pos/4.1.kt", - "unexpectedBehaviour": false - }, - { - "specVersion": "0.1-268", - "casesNumber": 0, - "description": "Current class companion object receiver has higher priority than any of the superclass companion objects;", "unexpectedBehaviour": false } ], "4": [ { - "specVersion": "0.1-268", + "specVersion": "0.1-278", "casesNumber": 0, "description": "Superclass companion object receivers are prioritized according to the inheritance order", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/p-5/pos/5.1.kt", + "unexpectedBehaviour": false + }, + { + "specVersion": "0.1-278", + "casesNumber": 0, + "description": "Current class companion object receiver has higher priority than any of the superclass companion objects;", "unexpectedBehaviour": false } ] 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.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.kt new file mode 100644 index 00000000000..8fadc45d276 --- /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.kt @@ -0,0 +1,58 @@ +// !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 + * 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.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.kt new file mode 100644 index 00000000000..594877634fc --- /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.kt @@ -0,0 +1,100 @@ +// !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 + * 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.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.kt new file mode 100644 index 00000000000..550657ff1aa --- /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.kt @@ -0,0 +1,53 @@ +// !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 + * 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() + } +} diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.1.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.1.kt new file mode 100644 index 00000000000..3bc3a22145d --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.1.kt @@ -0,0 +1,166 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION -NOTHING_TO_INLINE -EXTENSION_SHADOWED_BY_MEMBER +// SKIP_TXT + +/* + * KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE) + * + * 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 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-without-an-explicit-receiver -> paragraph 6 -> sentence 1 + * NUMBER: 1 + * DESCRIPTION: The overload candidate sets for each pair of implicit receivers: Local extension callables + */ + +// FILE: TestCase.kt +// TESTCASE NUMBER: 1 +package testsCase1 +import libPackageCase1.* +import libPackageCase1Explicit.emptyArray + +class Case1(){ + fun emptyArray(): Array = TODO() + + fun case1() { + fun Case1.emptyArray(): Array = TODO() + + emptyArray() + } +} +// 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: LibtestsPack.kt +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 + +class Case2(){ + fun emptyArray(): Array = TODO() + + val emptyArray: A + get() = A() + + fun case1() { + fun Case2.emptyArray(): Array = TODO() + + emptyArray() + } +} +class A { + operator fun invoke(): T = TODO() +} +// FILE: Lib.kt +package libPackageCase2 +import testsCase2.* + +val Case2.emptyArray: A + get() = A() +public fun emptyArray(): Array = TODO() +fun Case2.emptyArray(): Array = TODO() + +// FILE: Lib.kt +package libPackageCase2Explicit +import testsCase2.* + +val Case2.emptyArray: A + get() = A() +fun Case2.emptyArray(): Array = TODO() + +public fun emptyArray(): Array = TODO() + +// FILE: LibtestsPack.kt +package testsCase2 +val Case2.emptyArray: A + get() = A() + +fun Case2.emptyArray(): Array = TODO() + +public fun emptyArray(): Array = TODO() + + + + +// FILE: TestCase.kt +// TESTCASE NUMBER: 3 +package testsCase3 +import libPackageCase3.* +import libPackageCase3Explicit.emptyArray + +class Case3(){ + fun Case3.emptyArray(): Array = TODO() + + val emptyArray: A + get() = A() + + fun case1() { + fun Case3.emptyArray(): Array = TODO() + + emptyArray() + } +} +class A { + operator fun invoke(): T = TODO() +} +// FILE: Lib.kt +// TESTCASE NUMBER: 3 + +package libPackageCase3 +import testsCase3.* + +val Case3.emptyArray: A + get() = A() +public fun emptyArray(): Array = TODO() +fun Case3.emptyArray(): Array = TODO() + +// FILE: Lib.kt +// TESTCASE NUMBER: 3 + +package libPackageCase3Explicit +import testsCase3.* + +val Case3.emptyArray: A + get() = A() +fun Case3.emptyArray(): Array = TODO() + +public fun emptyArray(): Array = TODO() + +// FILE: LibtestsPack.kt +// TESTCASE NUMBER: 3 + +package testsCase3 +val Case3.emptyArray: A + get() = A() + +fun Case3.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/pos/2.2.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.2.kt new file mode 100644 index 00000000000..4d566b16b64 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.2.kt @@ -0,0 +1,188 @@ +// !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 (POSITIVE) + * + * 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 2 + * 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 + * NUMBER: 2 + * DESCRIPTION: The overload candidate sets for each pair of implicit receivers: Local extension callables + */ + +// FILE: TestCase.kt +// TESTCASE NUMBER: 1 +package testsCase1 +import libPackageCase1.* +import libPackageCase1Explicit.emptyArray + +class Case1(){ + + fun case1_0() { + fun Case1.emptyArray(): Array = TODO() + + emptyArray() + + fun case1_1() { + fun Case1.emptyArray(): Array = TODO() + emptyArray() + } + } + +} + +// 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: LibtestsPack.kt +package testsCase1 +fun Case1.emptyArray(): Array = TODO() + +public fun emptyArray(): Array = TODO() + + +// FILE: TestCase.kt + +/* + * TESTCASE NUMBER: 2 + * UNEXPECTED BEHAVIOUR + * ISSUES: KT-37179 + */ +package testsCase2 +import libPackageCase2.* +import libPackageCase2Explicit.emptyArray + +class Case2(){ + + fun case1_0() { + fun Case2.emptyArray(): Array = TODO() + emptyArray() + + fun case1_1() { + fun Case2.emptyArray(): Array = TODO() + emptyArray() + } + } + + val Case2.emptyArray: A + get() = A() + + fun Case2.emptyArray(): Array = TODO() + + fun case2_0(){ + emptyArray() + } + +} +class A { + operator fun invoke(): T = TODO() +} + +// FILE: Lib.kt +// TESTCASE NUMBER: 2 +package libPackageCase2 +import testsCase2.* +val Case2.emptyArray: A + get() = A() +public fun emptyArray(): Array = TODO() +fun Case2.emptyArray(): Array = TODO() + +// FILE: Lib.kt +// TESTCASE NUMBER: 2 + +package libPackageCase2Explicit +import testsCase2.* + +fun Case2.emptyArray(): Array = TODO() + +public fun emptyArray(): Array = TODO() + +// FILE: LibtestsPack.kt +// TESTCASE NUMBER: 2 + +package testsCase2 +fun Case2.emptyArray(): Array = TODO() + +public fun emptyArray(): Array = TODO() + + +// FILE: TestCase.kt + +/* + * TESTCASE NUMBER: 3 + * UNEXPECTED BEHAVIOUR + * ISSUES: KT-37179 + */ +package testsCase3 +import libPackageCase3.* +import libPackageCase3Explicit.emptyArray + +class Case3(){ + + fun case1_0() { + //fun Case3.emptyArray(): Array = TODO() + emptyArray() + + fun case1_1() { + // fun Case3.emptyArray(): Array = TODO() + emptyArray() + } + } + + val Case3.emptyArray: A + get() = A() + + //fun Case3.emptyArray(): Array = TODO() + + fun case2_0(){ + emptyArray() + } + +} +class A { + operator fun invoke(): T = TODO() +} + +// FILE: Lib.kt +// TESTCASE NUMBER: 3 +package libPackageCase3 +import testsCase3.* +val Case3.emptyArray: A + get() = A() +public fun emptyArray(): Array = TODO() +fun Case3.emptyArray(): Array = TODO() + +// FILE: Lib.kt +// TESTCASE NUMBER: 3 + +package libPackageCase3Explicit +import testsCase3.* + +fun Case3.emptyArray(): Array = TODO() + +public fun emptyArray(): Array = TODO() + +// FILE: LibtestsPack.kt +// TESTCASE NUMBER: 3 +package testsCase3 +fun Case3.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/pos/2.3.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.3.kt new file mode 100644 index 00000000000..94aa84376b3 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.3.kt @@ -0,0 +1,139 @@ +// !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 (POSITIVE) + * + * 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-without-an-explicit-receiver -> paragraph 6 -> sentence 1 + * NUMBER: 3 + * DESCRIPTION: The overload candidate sets for each pair of implicit receivers: Explicitly imported extension callables + */ + +// FILE: TestCase.kt +// TESTCASE NUMBER: 1 + +package testsCase1 +import libPackageCase1.* +import libPackageCase1Explicit.emptyArray + +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 +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 +// TESTCASE NUMBER: 2 + +package testsCase2 +import libPackageCase2.* +import libPackageCase2Explicit.emptyArray + +class Case2(){ + + fun case1() { + emptyArray() + } +} + +class A { + operator fun invoke(): T = TODO() +} + +// FILE: Lib.kt +package libPackageCase2 +import testsCase2.* + +public fun emptyArray(): Array = TODO() +fun Case2.emptyArray(): Array = TODO() + +// FILE: Lib.kt +package libPackageCase2Explicit +import testsCase2.* + +val Case2.emptyArray: A + get() = A() + +fun Case2.emptyArray(): Array = TODO() + +public fun emptyArray(): Array = TODO() + +// FILE: LibtestsPack.kt +package testsCase2 +fun Case2.emptyArray(): Array = TODO() + +public fun emptyArray(): Array = TODO() + + + +// FILE: TestCase.kt +// TESTCASE NUMBER: 3 + +package testsCase3 +import libPackageCase3.* +import libPackageCase3Explicit.emptyArray + +class Case3(){ + + fun case1() { + emptyArray() + } +} + +class A { + operator fun invoke(): T = TODO() +} + +// FILE: Lib.kt +package libPackageCase3 +import testsCase3.* + +public fun emptyArray(): Array = TODO() +fun Case3.emptyArray(): Array = TODO() + +// FILE: Lib.kt +package libPackageCase3Explicit +import testsCase3.* + +val Case3.emptyArray: A + get() = A() + +private fun Case3.emptyArray(): Array = TODO() + +public fun emptyArray(): Array = TODO() + +// FILE: LibtestsPack.kt +package testsCase3 +fun Case3.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/pos/2.4.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.4.kt new file mode 100644 index 00000000000..b0474cf0e71 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.4.kt @@ -0,0 +1,128 @@ +// !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 (POSITIVE) + * + * 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 + * 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 + +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 +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 + +class Case2(){ + + fun case1() { + emptyArray() + } +} +class A { + operator fun invoke(): T = TODO() +} + +// FILE: Lib.kt +package libPackageCase2 +import testsCase2.* + +val Case2.emptyArray: A + get() = A() + +fun emptyArray(): Array = TODO() +fun Case2.emptyArray(): Array = TODO() + +// FILE: Lib.kt +package libPackageCase2Explicit + +public fun emptyArray(): Array = TODO() + +// FILE: LibtestsPack.kt +package testsCase2 +fun Case2.emptyArray(): Array = TODO() + +public fun emptyArray(): Array = TODO() +val Case2.emptyArray: A + get() = A() + +// FILE: TestCase.kt +// TESTCASE NUMBER: 3 +package testsCase3 +import libPackageCase3.* +import libPackageCase3Explicit.emptyArray + +class Case3(){ + + fun case1() { + emptyArray() + } +} +class A { + operator fun invoke(): T = TODO() +} + +// FILE: Lib.kt +package libPackageCase3 +import testsCase3.* + +fun emptyArray(): Array = TODO() +fun Case3.emptyArray(): Array = TODO() + +// FILE: Lib.kt +package libPackageCase3Explicit + +public fun emptyArray(): Array = TODO() + +// FILE: LibtestsPack.kt +package testsCase3 + +val Case3.emptyArray: A + get() = A() + +private fun Case3.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/pos/2.5.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.5.kt new file mode 100644 index 00000000000..64140d2a581 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.5.kt @@ -0,0 +1,123 @@ +// !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 (POSITIVE) + * + * 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-without-an-explicit-receiver -> paragraph 6 -> sentence 1 + * NUMBER: 5 + * DESCRIPTION: The overload candidate sets for each pair of implicit receivers: Implicitly imported extension callables + */ + +// FILE: TestCase.kt +// TESTCASE NUMBER: 1 +package testsCase1 +import libPackageCase1.* +import libPackageCase1Explicit.emptyArray + +class Case1(){ + + fun case() { + 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 +package testsCase1 + +public fun emptyArray(): Array = TODO() + + +// FILE: TestCase.kt +// TESTCASE NUMBER: 2 +package testsCase2 +import libPackageCase2.* +import libPackageCase2Explicit.emptyArray + +class Case2(){ + + fun case() { + emptyArray() + } +} +class A { + operator fun invoke(): T = TODO() +} + + +// FILE: Lib.kt +package libPackageCase2 +import testsCase2.* + +val Case2.emptyArray: A + get() = A() + +public fun emptyArray(): Array = TODO() +fun Case2.emptyArray(): Array = TODO() + +// FILE: Lib.kt +package libPackageCase2Explicit + +public fun emptyArray(): Array = TODO() + +// FILE: LibtestsPack.kt +package testsCase2 + +public fun emptyArray(): Array = TODO() + + +// FILE: TestCase.kt +// TESTCASE NUMBER: 3 +package testsCase3 +import libPackageCase3.* +import libPackageCase3Explicit.emptyArray + +class Case3(){ + + fun case() { + emptyArray() + } +} +class A { + operator fun invoke(): T = TODO() +} + + +// FILE: Lib.kt +package libPackageCase3 +import testsCase3.* + +val Case3.emptyArray: A + get() = A() + +fun emptyArray(): Array = TODO() +private fun Case3.emptyArray(): Array = TODO() + +// FILE: Lib.kt +package libPackageCase3Explicit + +public fun emptyArray(): Array = TODO() + +// FILE: LibtestsPack.kt +package testsCase3 + +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/pos/4.1.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.1.kt new file mode 100644 index 00000000000..570774c2110 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.1.kt @@ -0,0 +1,106 @@ +// !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 (POSITIVE) + * + * SPEC VERSION: 0.1-278 + * PLACE: overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 5 -> sentence 4 + * 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-without-an-explicit-receiver -> paragraph 6 -> sentence 1 + * NUMBER: 1 + * DESCRIPTION: Top-level non-extension functions: Callables explicitly imported into the current file + */ + +// FILE: TestCase.kt +// TESTCASE NUMBER: 1 +package testsCase1 +import libPackageCase1.* +import libPackageCase1Explicit.emptyArray + +fun case1() { + emptyArray() +} + +// FILE: Lib.kt +package libPackageCase1 + +public fun 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 +// TESTCASE NUMBER: 2 +package testsCase2 +import libPackageCase2.* +import libPackageCase2Explicit.emptyArray + +fun case2() { + emptyArray() +} +class A { + operator fun invoke(): T = TODO() +} +// FILE: Lib.kt +package libPackageCase2 + +public fun emptyArray(): Array = TODO() + +// FILE: Lib.kt +package libPackageCase2Explicit +import testsCase2.* + +val emptyArray: A + get() = A() + +public fun emptyArray(): Array = TODO() + +// FILE: LibtestsPack.kt +package testsCase2 + +public fun emptyArray(): Array = TODO() + + + +// FILE: TestCase.kt +// TESTCASE NUMBER: 3 +package testsCase3 +import libPackageCase3.* +import libPackageCase3Explicit.emptyArray + +fun case3() { + emptyArray() +} +class A { + operator fun invoke(): T = TODO() +} +// FILE: Lib.kt +package libPackageCase3 + +public fun emptyArray(): Array = TODO() + +// FILE: Lib.kt +package libPackageCase3Explicit +import testsCase3.* + +val emptyArray: A + get() = A() + +private fun emptyArray(): Array = TODO() + +// FILE: LibtestsPack.kt +package testsCase3 + +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/pos/5.1.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/5.1.kt new file mode 100644 index 00000000000..27d3c0b852c --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/5.1.kt @@ -0,0 +1,90 @@ +// !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 (POSITIVE) + * + * SPEC VERSION: 0.1-278 + * PLACE: overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 5 -> sentence 5 + * 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-without-an-explicit-receiver -> paragraph 6 -> sentence 1 + * NUMBER: 1 + * DESCRIPTION: Top-level non-extension functions: Callables declared in the same package + */ + +// FILE: TestCase.kt +// TESTCASE NUMBER: 1 +package testsCase1 +import libPackageCase1.* + +fun case1() { + emptyArray() +} + +// FILE: Lib.kt +package libPackageCase1 + +public fun emptyArray(): Array = TODO() + +// FILE: LibtestsPack.kt +package testsCase1 + +public fun emptyArray(): Array = TODO() + +// FILE: TestCase.kt +// TESTCASE NUMBER: 2 +package testsCase2 +import libPackageCase2.* + +fun case2() { + emptyArray() +} + +// FILE: Lib.kt +package libPackageCase2 + +public fun emptyArray(): Array = TODO() + +// FILE: LibtestsPack.kt +package testsCase2 +import testsCase2.* + +public val emptyArray: A + get() = A() + +class A { + operator fun invoke(): T = TODO() +} + +public fun emptyArray(): Array = TODO() + + +// FILE: TestCase.kt +// TESTCASE NUMBER: 3 +package testsCase3 +import libPackageCase3.* + +fun case3() { + emptyArray() +} + +// FILE: Lib.kt +package libPackageCase3 + +public fun emptyArray(): Array = TODO() + +// FILE: LibtestsPack.kt +package testsCase3 +import testsCase3.* + +public val emptyArray: A + get() = A() + +class A { + operator fun invoke(): T = TODO() +} + +private 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/pos/6.1.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/6.1.kt new file mode 100644 index 00000000000..2b2a53d68a8 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/6.1.kt @@ -0,0 +1,76 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION +// SKIP_TXT + +/* + * KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE) + * + * SPEC VERSION: 0.1-278 + * PLACE: overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 5 -> sentence 6 + * 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-without-an-explicit-receiver -> paragraph 6 -> sentence 1 + * NUMBER: 1 + * DESCRIPTION: Top-level non-extension functions: Callables star-imported into the current file; + */ + +// FILE: TestCase.kt +// TESTCASE NUMBER: 1 +package testsCase1 + +import libPackageCase1.* + +fun case1() { + emptyArray() +} +// FILE: Lib.kt +package libPackageCase1 + +public fun emptyArray(): Array = TODO() + + +// FILE: TestCase.kt +// TESTCASE NUMBER: 2 +package testsCase2 +import libPackageCase2.* + +fun case2() { + emptyArray() +} + + +class A { + operator fun invoke(): T = TODO() +} + +// FILE: Lib.kt +package libPackageCase2 +import testsCase2.* + +public fun emptyArray(): Array = TODO() + +val emptyArray: A + get() = A() + +// FILE: TestCase.kt +// TESTCASE NUMBER: 3 +package testsCase3 +import libPackageCase3.* + +fun case3() { + emptyArray() +} + + +class A { + operator fun invoke(): T = TODO() +} + +// FILE: Lib.kt +package libPackageCase3 +import testsCase3.* + +private fun emptyArray(): Array = TODO() + +val emptyArray: A + get() = A() \ No newline at end of file diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/7.1.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/7.1.kt new file mode 100644 index 00000000000..96463bc3038 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/7.1.kt @@ -0,0 +1,54 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION +// SKIP_TXT + +/* + * KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE) + * + * SPEC VERSION: 0.1-278 + * PLACE: overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 5 -> sentence 7 + * 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-without-an-explicit-receiver -> paragraph 6 -> sentence 1 + * NUMBER: 1 + * DESCRIPTION: Top-level non-extension functions: Implicitly imported callables + */ + +// FILE: TestCase.kt +// TESTCASE NUMBER: 1 +package testsCase1 +import libPackageCase1.* //nothing to import, function emptyArray is private + +fun case1() { + emptyArray() +} +// FILE: Lib.kt +package libPackageCase1 + +private fun emptyArray(): Array = TODO() + +// FILE: TestCase.kt +// TESTCASE NUMBER: 2 +package testscase2 + +import libPackagecase2.* //nothing to import, emptyArray is private + +class Case2 { + + fun case2() { + emptyArray() + } +} + +class A { + operator fun invoke(): T = TODO() +} + +// FILE: Lib.kt +package libPackagecase2 +import testscase2.* +private fun emptyArray(): Array = TODO() + +private val Case2.emptyArray: A + get() = A() + diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/testsMap.json b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/testsMap.json new file mode 100644 index 00000000000..7d48cb3f98d --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/testsMap.json @@ -0,0 +1,186 @@ +{ + "5": { + "neg": { + "2": [ + { + "specVersion": "0.1-278", + "casesNumber": 1, + "description": "The overload candidate sets for each pair of implicit receivers: Implicitly imported extension callables", + "unexpectedBehaviour": false + }, + { + "specVersion": "0.1-278", + "casesNumber": 2, + "description": "The overload candidate sets for each pair of implicit receivers: declared in the package scope extension callables", + "unexpectedBehaviour": false + }, + { + "specVersion": "0.1-278", + "casesNumber": 1, + "description": "The overload candidate sets for each pair of implicit receivers: Explicitly imported extension callables", + "unexpectedBehaviour": false + } + ] + }, + "pos": { + "2": [ + { + "specVersion": "0.1-278", + "casesNumber": 3, + "description": "The overload candidate sets for each pair of implicit receivers: Local extension callables", + "unexpectedBehaviour": false + }, + { + "specVersion": "0.1-278", + "casesNumber": 3, + "description": "The overload candidate sets for each pair of implicit receivers: Implicitly imported extension callables", + "unexpectedBehaviour": false + }, + { + "specVersion": "0.1-278", + "casesNumber": 3, + "description": "The overload candidate sets for each pair of implicit receivers: declared in the package scope extension callables", + "unexpectedBehaviour": false + }, + { + "specVersion": "0.1-278", + "casesNumber": 3, + "description": "The overload candidate sets for each pair of implicit receivers: Explicitly imported extension callables", + "unexpectedBehaviour": false + }, + { + "specVersion": "0.1-278", + "casesNumber": 3, + "description": "The overload candidate sets for each pair of implicit receivers: Local extension callables", + "unexpectedBehaviour": true + } + ], + "4": [ + { + "specVersion": "0.1-278", + "casesNumber": 3, + "description": "Top-level non-extension functions: Callables explicitly imported into the current file", + "unexpectedBehaviour": false + } + ], + "5": [ + { + "specVersion": "0.1-278", + "casesNumber": 3, + "description": "Top-level non-extension functions: Callables declared in the same package", + "unexpectedBehaviour": false + } + ], + "6": [ + { + "specVersion": "0.1-278", + "casesNumber": 3, + "description": "Top-level non-extension functions: Callables star-imported into the current file;", + "unexpectedBehaviour": false + } + ], + "7": [ + { + "specVersion": "0.1-278", + "casesNumber": 2, + "description": "Top-level non-extension functions: Implicitly imported callables", + "unexpectedBehaviour": false + } + ] + } + }, + "4": { + "neg": { + "1": [ + { + "specVersion": "0.1-278", + "casesNumber": 1, + "description": "The overload candidate sets for each pair of implicit receivers: Implicitly imported extension callables", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.5.kt", + "unexpectedBehaviour": false + }, + { + "specVersion": "0.1-278", + "casesNumber": 2, + "description": "The overload candidate sets for each pair of implicit receivers: declared in the package scope extension callables", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.4.kt", + "unexpectedBehaviour": false + }, + { + "specVersion": "0.1-278", + "casesNumber": 1, + "description": "The overload candidate sets for each pair of implicit receivers: Explicitly imported extension callables", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.3.kt", + "unexpectedBehaviour": false + } + ] + }, + "pos": { + "1": [ + { + "specVersion": "0.1-278", + "casesNumber": 3, + "description": "The overload candidate sets for each pair of implicit receivers: Local extension callables", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.1.kt", + "unexpectedBehaviour": false + }, + { + "specVersion": "0.1-278", + "casesNumber": 3, + "description": "The overload candidate sets for each pair of implicit receivers: Implicitly imported extension callables", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.5.kt", + "unexpectedBehaviour": false + }, + { + "specVersion": "0.1-278", + "casesNumber": 3, + "description": "The overload candidate sets for each pair of implicit receivers: declared in the package scope extension callables", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.4.kt", + "unexpectedBehaviour": false + }, + { + "specVersion": "0.1-278", + "casesNumber": 3, + "description": "Top-level non-extension functions: Callables explicitly imported into the current file", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.1.kt", + "unexpectedBehaviour": false + }, + { + "specVersion": "0.1-278", + "casesNumber": 3, + "description": "Top-level non-extension functions: Callables declared in the same package", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/5.1.kt", + "unexpectedBehaviour": false + }, + { + "specVersion": "0.1-278", + "casesNumber": 3, + "description": "Top-level non-extension functions: Callables star-imported into the current file;", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/6.1.kt", + "unexpectedBehaviour": false + }, + { + "specVersion": "0.1-278", + "casesNumber": 2, + "description": "Top-level non-extension functions: Implicitly imported callables", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/7.1.kt", + "unexpectedBehaviour": false + }, + { + "specVersion": "0.1-278", + "casesNumber": 3, + "description": "The overload candidate sets for each pair of implicit receivers: Explicitly imported extension callables", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.3.kt", + "unexpectedBehaviour": false + }, + { + "specVersion": "0.1-278", + "casesNumber": 3, + "description": "The overload candidate sets for each pair of implicit receivers: Local extension callables", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.2.kt", + "unexpectedBehaviour": true + } + ] + } + } +} \ No newline at end of file diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos/2.1.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos/2.1.kt new file mode 100644 index 00000000000..033775c546a --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos/2.1.kt @@ -0,0 +1,93 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION +// SKIP_TXT + +/* + * KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE) + * + * SPEC VERSION: 0.1-278 + * PLACE: overload-resolution, receivers -> paragraph 5 -> sentence 2 + * RELEVANT PLACES: overload-resolution, receivers -> paragraph 5 -> sentence 1 + * overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 5 -> sentence 2 + * NUMBER: 1 + * DESCRIPTION: The implicit this receiver has higher priority than phantom static implicit this + */ + +// FILE: TestCase.kt +// TESTCASE NUMBER: 1 +package testsCase1 + +open class A { + operator fun invoke() = print("invoke") +} + +open class B { + operator fun invoke() = print("invoke") +} + +enum class Super_2 { + V1, V2; + + val values = A() + + private fun case() { + values() + } + + enum class NestedWithCompanion { + V1; + + val values = B() + + private fun case() { + values() + } + } + + enum class Nested { + V1; + + private fun case() { + values() + } + } +} + +// FILE: TestCase.kt +// TESTCASE NUMBER: 2 +package testsCase2 + +open class A { + operator fun invoke(value: String) = print("invoke $value") +} +open class B { + operator fun invoke(value: String) = print("invoke $value") +} + +enum class Super_2 { + V1, V2; + + val valueOf = A() + + private fun case() { + valueOf("") + } + + enum class NestedWithCompanion { + V1; + + val valueOf = B() + + private fun case() { + valueOf("") + } + } + + enum class Nested { + V1; + + private fun case() { + valueOf("") + } + } +} diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos/3.1.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos/3.1.kt new file mode 100644 index 00000000000..d628d7b5bbc --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos/3.1.kt @@ -0,0 +1,163 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION +// SKIP_TXT + +/* + * KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE) + * + * SPEC VERSION: 0.1-278 + * PLACE: overload-resolution, receivers -> paragraph 5 -> sentence 3 + * RELEVANT PLACES: overload-resolution, receivers -> paragraph 5 -> sentence 1 + * overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 5 -> sentence 2 + * NUMBER: 1 + * DESCRIPTION: The phantom static implicit this receiver has higher priority than the current class companion object receiver + */ + +// FILE: TestCase.kt +// TESTCASE NUMBER: 1 +package testsCase1 + +open class A { + operator fun invoke() = print("invoke") +} + +enum class Super_2 { + V1, V2; + + companion object values : A() {} + + private fun case() { + values() + } + + enum class NestedWithCompanion { + V1; + + companion object values : A() {} + + private fun case() { + values() + } + } + + enum class Nested { + V1; + + private fun case() { + values() + } + } +} + +// FILE: TestCase.kt +// TESTCASE NUMBER: 2 +package testsCase2 + +open class A { + operator fun invoke(value: String) = print("invoke $value") +} + +enum class Super_2 { + V1, V2; + + companion object valueOf : A() {} + + private fun case() { + valueOf("") + } + + enum class NestedWithCompanion { + V1; + + companion object valueOf : A() {} + + private fun case() { + valueOf("") + } + } + + enum class Nested { + V1; + + private fun case() { + valueOf("") + } + } +} + + +// FILE: TestCase.kt +// TESTCASE NUMBER: 3 +package testsCase3 + +open class A { + operator fun invoke() = print("invoke") +} + +enum class Super_2 { + V1, V2; + + object values : A() {} + + private fun case() { + values() + } + + enum class NestedWithCompanion { + V1; + + object values : A() {} + + private fun case() { + values() + } + } + + enum class Nested { + V1; + + private fun case() { + values() + } + } +} + +// FILE: TestCase.kt +// TESTCASE NUMBER: 4 +package testsCase4 + +open class A { + operator fun invoke(value: String) = print("invoke $value") +} +open class B { + operator fun invoke(value: String) = print("invoke $value") +} + +enum class Super_2 { + V1, V2; + + object valueOf : A() {} + + private fun case() { + valueOf("") + } + + enum class NestedWithCompanion { + V1; + + object valueOf : B() {} + + private fun case() { + valueOf("") + } + } + + enum class Nested { + V1; + + private fun case() { + valueOf("") + } + } +} + diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos/5.1.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos/5.1.kt new file mode 100644 index 00000000000..818dac4d22d --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos/5.1.kt @@ -0,0 +1,202 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION +// SKIP_TXT + +/* + * KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE) + * + * SPEC VERSION: 0.1-278 + * PLACE: overload-resolution, receivers -> paragraph 5 -> sentence 5 + * RELEVANT PLACES: overload-resolution, receivers -> paragraph 5 -> sentence 4 + * overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 5 -> sentence 2 + * NUMBER: 1 + * DESCRIPTION: Superclass companion object receivers are prioritized according to the inheritance order + */ + +// FILE: TestCase.kt +// TESTCASE NUMBER: 1 +package testsCase1 + +open class A { + operator fun invoke() = print("invoke") +} + +interface Super_0 { + companion object values : A() + + private fun case() { + values() + } +} + +open class Super_1 : Super_0 { + companion object values : A() {} + + private fun case() { + values() + } +} + +open class Super_2 : Super_1() { + + private fun case() { + values() + } + + class Nested : Super_1() { + companion object values : A() {} + + private fun case() { + values() + } + } + + inner class Inner : Super_1() { + private fun case() { + values() + } + } + +} + + +// FILE: TestCase.kt +// TESTCASE NUMBER: 2 +package testsCase2 + +open class A { + operator fun invoke(value: String) = print("invoke $value") +} + +interface Super_0 { + companion object valueOf : A() + + private fun case() { + valueOf("") + } +} + +open class Super_1 : Super_0 { + companion object valueOf : A() {} + + private fun case() { + valueOf("") + } +} + +open class Super_2 : Super_1() { + + private fun case() { + valueOf("") + } + + class Nested : Super_1() { + companion object valueOf : A() {} + + private fun case() { + valueOf("") + } + } + + inner class Inner : Super_1() { + private fun case() { + valueOf("") + } + } + +} + +// FILE: TestCase.kt +// TESTCASE NUMBER: 3 +package testsCase3 + +open class A { + operator fun invoke() = print("invoke") +} + +interface Super_0 { + object values : A() + + private fun case() { + values() + } +} + +open class Super_1 : Super_0 { + object values : A() {} + + private fun case() { + values() + } +} + +open class Super_2 : Super_1() { + + private fun case() { + values() + } + + class Nested : Super_1() { + object values : A() {} + + private fun case() { + values() + } + } + + inner class Inner : Super_1() { + private fun case() { + values() + } + } + +} + + +// FILE: TestCase.kt +// TESTCASE NUMBER: 4 +package testsCase4 + +open class A { + operator fun invoke(value: String) = print("invoke $value") +} + +interface Super_0 { + object valueOf : A() + + private fun case() { + valueOf("") + } +} + +open class Super_1 : Super_0 { + object valueOf : A() {} + + private fun case() { + valueOf("") + } +} + +open class Super_2 : Super_1() { + + private fun case() { + valueOf("") + } + + class Nested : Super_1() { + object valueOf : A() {} + + private fun case() { + valueOf("") + } + } + + inner class Inner : Super_1() { + private fun case() { + valueOf("") + } + } + +} + + diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/testsMap.json b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/testsMap.json new file mode 100644 index 00000000000..7c1112435bc --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/testsMap.json @@ -0,0 +1,55 @@ +{ + "5": { + "pos": { + "2": [ + { + "specVersion": "0.1-278", + "casesNumber": 2, + "description": "The implicit this receiver has higher priority than phantom static implicit this", + "unexpectedBehaviour": false + } + ], + "1": [ + { + "specVersion": "0.1-278", + "casesNumber": 2, + "description": "The implicit this receiver has higher priority than phantom static implicit this", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos/2.1.kt", + "unexpectedBehaviour": false + }, + { + "specVersion": "0.1-278", + "casesNumber": 4, + "description": "The phantom static implicit this receiver has higher priority than the current class companion object receiver", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos/3.1.kt", + "unexpectedBehaviour": false + } + ], + "3": [ + { + "specVersion": "0.1-278", + "casesNumber": 4, + "description": "The phantom static implicit this receiver has higher priority than the current class companion object receiver", + "unexpectedBehaviour": false + } + ], + "5": [ + { + "specVersion": "0.1-278", + "casesNumber": 4, + "description": "Superclass companion object receivers are prioritized according to the inheritance order", + "unexpectedBehaviour": false + } + ], + "4": [ + { + "specVersion": "0.1-278", + "casesNumber": 4, + "description": "Superclass companion object receivers are prioritized according to the inheritance order", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos/5.1.kt", + "unexpectedBehaviour": false + } + ] + } + } +} \ No newline at end of file diff --git a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/checkers/DiagnosticsTestSpecGenerated.java b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/checkers/DiagnosticsTestSpecGenerated.java index a11091d1153..c40d4554483 100644 --- a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/checkers/DiagnosticsTestSpecGenerated.java +++ b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/checkers/DiagnosticsTestSpecGenerated.java @@ -3504,6 +3504,118 @@ public class DiagnosticsTestSpecGenerated extends AbstractDiagnosticsTestSpec { } } + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Call_without_an_explicit_receiver extends AbstractDiagnosticsTestSpec { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInCall_without_an_explicit_receiver() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class P_5 extends AbstractDiagnosticsTestSpec { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInP_5() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Neg extends AbstractDiagnosticsTestSpec { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + @TestMetadata("2.3.kt") + public void test2_3() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.3.kt"); + } + + @TestMetadata("2.4.kt") + public void test2_4() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.4.kt"); + } + + @TestMetadata("2.5.kt") + public void test2_5() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.5.kt"); + } + + public void testAllFilesPresentInNeg() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Pos extends AbstractDiagnosticsTestSpec { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + @TestMetadata("2.1.kt") + public void test2_1() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.1.kt"); + } + + @TestMetadata("2.2.kt") + public void test2_2() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.2.kt"); + } + + @TestMetadata("2.3.kt") + public void test2_3() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.3.kt"); + } + + @TestMetadata("2.4.kt") + public void test2_4() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.4.kt"); + } + + @TestMetadata("2.5.kt") + public void test2_5() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.5.kt"); + } + + @TestMetadata("4.1.kt") + public void test4_1() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.1.kt"); + } + + @TestMetadata("5.1.kt") + public void test5_1() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/5.1.kt"); + } + + @TestMetadata("6.1.kt") + public void test6_1() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/6.1.kt"); + } + + @TestMetadata("7.1.kt") + public void test7_1() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/7.1.kt"); + } + + public void testAllFilesPresentInPos() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + } + } + } + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -3778,6 +3890,60 @@ public class DiagnosticsTestSpecGenerated extends AbstractDiagnosticsTestSpec { } } } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Receivers extends AbstractDiagnosticsTestSpec { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInReceivers() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class P_5 extends AbstractDiagnosticsTestSpec { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInP_5() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Pos extends AbstractDiagnosticsTestSpec { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + @TestMetadata("2.1.kt") + public void test2_1() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos/2.1.kt"); + } + + @TestMetadata("3.1.kt") + public void test3_1() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos/3.1.kt"); + } + + @TestMetadata("5.1.kt") + public void test5_1() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos/5.1.kt"); + } + + public void testAllFilesPresentInPos() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + } + } + } } @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/statements") diff --git a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/codegen/BlackBoxCodegenTestSpecGenerated.java b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/codegen/BlackBoxCodegenTestSpecGenerated.java index ef8957b2a2a..3c618641142 100644 --- a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/codegen/BlackBoxCodegenTestSpecGenerated.java +++ b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/codegen/BlackBoxCodegenTestSpecGenerated.java @@ -3582,14 +3582,14 @@ public class BlackBoxCodegenTestSpecGenerated extends AbstractBlackBoxCodegenTes runTest("compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/p-5/pos/3.1.kt"); } - @TestMetadata("3.2.kt") - public void test3_2() throws Exception { - runTest("compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/p-5/pos/3.2.kt"); + @TestMetadata("4.2.kt") + public void test4_2() throws Exception { + runTest("compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/p-5/pos/4.2.kt"); } - @TestMetadata("4.1.kt") - public void test4_1() throws Exception { - runTest("compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/p-5/pos/4.1.kt"); + @TestMetadata("5.1.kt") + public void test5_1() throws Exception { + runTest("compiler/tests-spec/testData/codegen/box/linked/overload-resolution/receivers/p-5/pos/5.1.kt"); } public void testAllFilesPresentInPos() throws Exception {