From 46774fb6d616b039bbe5ad4f962452b0838c15bf Mon Sep 17 00:00:00 2001 From: "anastasiia.spaseeva" Date: Tue, 28 Jul 2020 11:14:42 +0300 Subject: [PATCH] [Spec tests] Add call without an explicit receiver tests for top-level non-extension functions --- .../declarations/type-alias/testsMap.json | 24 ++++ .../p-5/neg/4.1.fir.kt | 29 ++++ .../p-5/neg/4.1.kt | 38 +++++ .../p-5/neg/4.2.fir.kt | 30 ++++ .../p-5/neg/4.2.kt | 39 ++++++ .../p-5/pos/4.2.fir.kt | 91 ++++++++++++ .../p-5/pos/4.2.kt | 100 +++++++++++++ .../p-5/pos/4.3.fir.kt | 88 ++++++++++++ .../p-5/pos/4.3.kt | 97 +++++++++++++ .../p-5/pos/4.4.fir.kt | 89 ++++++++++++ .../p-5/pos/4.4.kt | 98 +++++++++++++ .../p-5/pos/4.5.fir.kt | 91 ++++++++++++ .../p-5/pos/4.5.kt | 101 ++++++++++++++ .../p-5/pos/4.6.fir.kt | 122 ++++++++++++++++ .../p-5/pos/4.6.kt | 132 ++++++++++++++++++ .../testsMap.json | 114 +++++++++++++++ .../DiagnosticsTestSpecGenerated.java | 41 +++++- .../FirDiagnosticsTestSpecGenerated.java | 41 +++++- 18 files changed, 1359 insertions(+), 6 deletions(-) create mode 100644 compiler/tests-spec/testData/diagnostics/linked/declarations/type-alias/testsMap.json 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/4.1.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/4.1.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/4.2.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/4.2.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/pos/4.2.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/pos/4.2.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/pos/4.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/pos/4.3.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/pos/4.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/pos/4.4.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/pos/4.5.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/pos/4.5.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/pos/4.6.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/pos/4.6.kt diff --git a/compiler/tests-spec/testData/diagnostics/linked/declarations/type-alias/testsMap.json b/compiler/tests-spec/testData/diagnostics/linked/declarations/type-alias/testsMap.json new file mode 100644 index 00000000000..5fe0bd323e3 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/declarations/type-alias/testsMap.json @@ -0,0 +1,24 @@ +{ + "1": { + "pos": { + "1": [ + { + "specVersion": "0.1-464", + "casesNumber": 3, + "description": "Top-level non-extension functions named f: 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.5.kt", + "unexpectedBehaviour": false, + "linkType": "primary" + }, + { + "specVersion": "0.1-464", + "casesNumber": 3, + "description": "Top-level non-extension functions named f: 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.6.kt", + "unexpectedBehaviour": false, + "linkType": "primary" + } + ] + } + } +} \ 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/neg/4.1.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/4.1.fir.kt new file mode 100644 index 00000000000..bb79cfa07a3 --- /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/4.1.fir.kt @@ -0,0 +1,29 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION +// SKIP_TXT + + + +// FILE: TestCase1.kt +// TESTCASE NUMBER: 1 + +package tests.case1 + +import lib.case1.* + +interface I +class A : I +class B : I + +fun case1(){ + A.invoke() +} + +// FILE: Lib.kt +package lib.case1 + +//fun A() : String = "" + +object A { + /*operator*/ fun invoke() : Int = 1 +} 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/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/neg/4.1.kt new file mode 100644 index 00000000000..86c91cbaa53 --- /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/4.1.kt @@ -0,0 +1,38 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION +// SKIP_TXT + +/* + * KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE) + * + * SPEC VERSION: 0.1-464 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 5 -> sentence 4 + * PRIMARY LINKS: overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 5 -> sentence 6 + * NUMBER: 1 + * DESCRIPTION: Top-level non-extension functions named f: callables implicitly imported into the current file; + */ + + +// FILE: TestCase1.kt +// TESTCASE NUMBER: 1 + +package tests.case1 + +import lib.case1.* + +interface I +class A : I +class B : I + +fun case1(){ + A.invoke() +} + +// FILE: Lib.kt +package lib.case1 + +//fun A() : String = "" + +object A { + /*operator*/ fun invoke() : Int = 1 +} 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/4.2.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/4.2.fir.kt new file mode 100644 index 00000000000..4a1f13cdafc --- /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/4.2.fir.kt @@ -0,0 +1,30 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION +// SKIP_TXT + + + +// FILE: TestCase1.kt +// TESTCASE NUMBER: 3 + +package tests.case1 + +import lib.case1.* + +interface I +//class A : I +class B : I + +fun case1(){ + A() + A() +} + +// FILE: Lib.kt +package lib.case1 + +//fun A() : String = "" + +object A { + /*operator*/ fun invoke() : Int = 1 +} 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/4.2.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/4.2.kt new file mode 100644 index 00000000000..13fd04b1624 --- /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/4.2.kt @@ -0,0 +1,39 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION +// SKIP_TXT + +/* + * KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE) + * + * SPEC VERSION: 0.1-464 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 5 -> sentence 4 + * PRIMARY LINKS: overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 5 -> sentence 6 + * NUMBER: 2 + * DESCRIPTION: Top-level non-extension functions named f: callables implicitly imported into the current file; + */ + + +// FILE: TestCase1.kt +// TESTCASE NUMBER: 3 + +package tests.case1 + +import lib.case1.* + +interface I +//class A : I +class B : I + +fun case1(){ + A() + A() +} + +// FILE: Lib.kt +package lib.case1 + +//fun A() : String = "" + +object A { + /*operator*/ fun invoke() : Int = 1 +} 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.2.fir.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.2.fir.kt new file mode 100644 index 00000000000..c9c2fac31c5 --- /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.2.fir.kt @@ -0,0 +1,91 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION +// SKIP_TXT + + +// FILE: TestCase1.kt +// TESTCASE NUMBER: 1 + +package tests.case1 + +import lib.case1.A + +interface I +class A : I +class B : I + +fun case1(){ + A() + A() + + B() + B() +} + +// FILE: Lib.kt +package lib.case1 + +fun A() : String = "" + +object A { + operator fun invoke() : Int = 1 +} + +// FILE: TestCase2.kt +// TESTCASE NUMBER: 2 + +package tests.case2 + +import lib.case2.A + +interface I +class A : I +class B : I + +fun case2(){ + A() + A() + + B() + B() +} + +// FILE: Lib.kt +package lib.case2 + +//fun A() : String = "" + +object A { + operator fun invoke() : Int = 1 +} + +// FILE: TestCase3.kt +// TESTCASE NUMBER: 3 + +package tests.case3 + +import lib.case3.A + +interface I +class A : I +class B : I + +fun case3(){ + A() + A() + + A.invoke() + A.invoke() + + B() + B() +} + +// FILE: Lib.kt +package lib.case3 + +//fun A() : String = "" + +object A { + /*operator*/ fun invoke() : Int = 1 +} 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.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/4.2.kt new file mode 100644 index 00000000000..1adda34d976 --- /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.2.kt @@ -0,0 +1,100 @@ +// !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-464 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 5 -> sentence 4 + * PRIMARY LINKS: overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 5 -> sentence 5 + * NUMBER: 2 + * DESCRIPTION: Top-level non-extension functions named f: callables explicitly imported into the current file; + */ + +// FILE: TestCase1.kt +// TESTCASE NUMBER: 1 + +package tests.case1 + +import lib.case1.A + +interface I +class A : I +class B : I + +fun case1(){ + A() + A() + + B() + ; typeCall: function")!>B() +} + +// FILE: Lib.kt +package lib.case1 + +fun A() : String = "" + +object A { + operator fun invoke() : Int = 1 +} + +// FILE: TestCase2.kt +// TESTCASE NUMBER: 2 + +package tests.case2 + +import lib.case2.A + +interface I +class A : I +class B : I + +fun case2(){ + A() + A() + + B() + ; typeCall: function")!>B() +} + +// FILE: Lib.kt +package lib.case2 + +//fun A() : String = "" + +object A { + operator fun invoke() : Int = 1 +} + +// FILE: TestCase3.kt +// TESTCASE NUMBER: 3 + +package tests.case3 + +import lib.case3.A + +interface I +class A : I +class B : I + +fun case3(){ + A() + ; typeCall: function")!>A() + + A.invoke() + A.invoke() + + B() + ; typeCall: function")!>B() +} + +// FILE: Lib.kt +package lib.case3 + +//fun A() : String = "" + +object A { + /*operator*/ fun invoke() : Int = 1 +} 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.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/pos/4.3.fir.kt new file mode 100644 index 00000000000..cb24e88b073 --- /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.3.fir.kt @@ -0,0 +1,88 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION +// SKIP_TXT + + +// FILE: TestCase1.kt +// TESTCASE NUMBER: 1 + +package tests.case1 + +import lib.case1.* + +interface I +class A : I +class B : I + +fun case1(){ + A() + A() + + B() + B() +} + +// FILE: Lib.kt +package lib.case1 + +fun A() : String = "" + +object A { + operator fun invoke() : Int = 1 +} + +// FILE: TestCase2.kt +// TESTCASE NUMBER: 2 + +package tests.case2 + +import lib.case2.* + +interface I +class A : I +class B : I + +fun case2(){ + A() + A() + + B() + B() +} + +// FILE: Lib.kt +package lib.case2 + +//fun A() : String = "" + +object A { + operator fun invoke() : Int = 1 +} + +// FILE: TestCase3.kt +// TESTCASE NUMBER: 3 + +package tests.case3 + +import lib.case3.* + +interface I +class A : I +class B : I + +fun case3(){ + A() + A() + + B() + B() +} + +// FILE: Lib.kt +package lib.case3 + +//fun A() : String = "" + +object A { + /*operator*/ fun invoke() : Int = 1 +} 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.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/4.3.kt new file mode 100644 index 00000000000..7aa118f32b3 --- /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.3.kt @@ -0,0 +1,97 @@ +// !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-464 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 5 -> sentence 4 + * PRIMARY LINKS: overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 5 -> sentence 6 + * NUMBER: 3 + * DESCRIPTION: Top-level non-extension functions named f: callables implicitly imported into the current file; + */ + +// FILE: TestCase1.kt +// TESTCASE NUMBER: 1 + +package tests.case1 + +import lib.case1.* + +interface I +class A : I +class B : I + +fun case1(){ + A() + ; typeCall: function")!>A() + + B() + ; typeCall: function")!>B() +} + +// FILE: Lib.kt +package lib.case1 + +fun A() : String = "" + +object A { + operator fun invoke() : Int = 1 +} + +// FILE: TestCase2.kt +// TESTCASE NUMBER: 2 + +package tests.case2 + +import lib.case2.* + +interface I +class A : I +class B : I + +fun case2(){ + A() + ; typeCall: function")!>A() + + B() + ; typeCall: function")!>B() +} + +// FILE: Lib.kt +package lib.case2 + +//fun A() : String = "" + +object A { + operator fun invoke() : Int = 1 +} + +// FILE: TestCase3.kt +// TESTCASE NUMBER: 3 + +package tests.case3 + +import lib.case3.* + +interface I +class A : I +class B : I + +fun case3(){ + A() + ; typeCall: function")!>A() + + B() + ; typeCall: function")!>B() +} + +// FILE: Lib.kt +package lib.case3 + +//fun A() : String = "" + +object A { + /*operator*/ fun invoke() : Int = 1 +} 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.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/pos/4.4.fir.kt new file mode 100644 index 00000000000..5e06259f0b3 --- /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.4.fir.kt @@ -0,0 +1,89 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION +// SKIP_TXT + + +// FILE: TestCase1.kt +// TESTCASE NUMBER: 1 + +package tests.case1 + +import lib.case1.* + +interface I +//class A : I +class B : I + +fun case1(){ + A() + A() + + B() + B() +} + +// FILE: Lib.kt +package lib.case1 + +fun A() : String = "" + +object A { + operator fun invoke() : Int = 1 +} + +// FILE: TestCase2.kt +// TESTCASE NUMBER: 2 + +package tests.case2 + +import lib.case2.* + +interface I +//class A : I +class B : I + +fun case2(){ + A() + A() + + B() + B() +} + +// FILE: Lib.kt +package lib.case2 + +//fun A() : String = "" + +object A { + operator fun invoke() : Int = 1 +} + +// FILE: TestCase3.kt +// TESTCASE NUMBER: 3 + +package tests.case3 + +import lib.case3.* + +interface I +//class A : I +class B : I + +fun case3(){ + + A.invoke() + A.invoke() + + B() + B() +} + +// FILE: Lib.kt +package lib.case3 + +//fun A() : String = "" + +object A { + /*operator*/ fun invoke() : Int = 1 +} 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.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/4.4.kt new file mode 100644 index 00000000000..eff98d77bdf --- /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.4.kt @@ -0,0 +1,98 @@ +// !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-464 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 5 -> sentence 4 + * PRIMARY LINKS: overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 5 -> sentence 6 + * NUMBER: 4 + * DESCRIPTION: Top-level non-extension functions named f: callables implicitly imported into the current file; + */ + +// FILE: TestCase1.kt +// TESTCASE NUMBER: 1 + +package tests.case1 + +import lib.case1.* + +interface I +//class A : I +class B : I + +fun case1(){ + A() + A() + + B() + ; typeCall: function")!>B() +} + +// FILE: Lib.kt +package lib.case1 + +fun A() : String = "" + +object A { + operator fun invoke() : Int = 1 +} + +// FILE: TestCase2.kt +// TESTCASE NUMBER: 2 + +package tests.case2 + +import lib.case2.* + +interface I +//class A : I +class B : I + +fun case2(){ + A() + A() + + B() + ; typeCall: function")!>B() +} + +// FILE: Lib.kt +package lib.case2 + +//fun A() : String = "" + +object A { + operator fun invoke() : Int = 1 +} + +// FILE: TestCase3.kt +// TESTCASE NUMBER: 3 + +package tests.case3 + +import lib.case3.* + +interface I +//class A : I +class B : I + +fun case3(){ + + A.invoke() + A.invoke() + + B() + ; typeCall: function")!>B() +} + +// FILE: Lib.kt +package lib.case3 + +//fun A() : String = "" + +object A { + /*operator*/ fun invoke() : Int = 1 +} 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.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/pos/4.5.fir.kt new file mode 100644 index 00000000000..663c80c08d2 --- /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.5.fir.kt @@ -0,0 +1,91 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION +// SKIP_TXT + + +// FILE: TestCase1.kt +// TESTCASE NUMBER: 1 + +package tests.case1 + +import lib.case1.B as A + +interface I +class A : I +class B : I + +fun case1(){ + A() + A() + + B() + B() +} + +// FILE: Lib.kt +package lib.case1 + +fun B() : String = "" + +object B { + operator fun invoke() : Int = 1 +} + +// FILE: TestCase2.kt +// TESTCASE NUMBER: 2 + +package tests.case2 + +import lib.case2.B as A + +interface I +class A : I +class B : I + +fun case2(){ + A() + A() + + B() + B() +} + +// FILE: Lib.kt +package lib.case2 + +//fun B() : String = "" + +object B { + operator fun invoke() : Int = 1 +} + +// FILE: TestCase3.kt +// TESTCASE NUMBER: 3 + +package tests.case3 + +import lib.case3.B as A + +interface I +class A : I +class B : I + +fun case3(){ + A() + A() + + A.invoke() + A.invoke() + + B() + B() +} + +// FILE: Lib.kt +package lib.case3 + +//fun B() : String = "" + +object B { + /*operator*/ fun invoke() : Int = 1 +} 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.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/4.5.kt new file mode 100644 index 00000000000..cf3b4f628fd --- /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.5.kt @@ -0,0 +1,101 @@ +// !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-464 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 5 -> sentence 4 + * PRIMARY LINKS: overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 5 -> sentence 5 + * declarations, type-alias -> paragraph 1 -> sentence 1 + * NUMBER: 5 + * DESCRIPTION: Top-level non-extension functions named f: callables explicitly imported into the current file; + */ + +// FILE: TestCase1.kt +// TESTCASE NUMBER: 1 + +package tests.case1 + +import lib.case1.B as A + +interface I +class A : I +class B : I + +fun case1(){ + A() + A() + + B() + ; typeCall: function")!>B() +} + +// FILE: Lib.kt +package lib.case1 + +fun B() : String = "" + +object B { + operator fun invoke() : Int = 1 +} + +// FILE: TestCase2.kt +// TESTCASE NUMBER: 2 + +package tests.case2 + +import lib.case2.B as A + +interface I +class A : I +class B : I + +fun case2(){ + A() + A() + + B() + ; typeCall: function")!>B() +} + +// FILE: Lib.kt +package lib.case2 + +//fun B() : String = "" + +object B { + operator fun invoke() : Int = 1 +} + +// FILE: TestCase3.kt +// TESTCASE NUMBER: 3 + +package tests.case3 + +import lib.case3.B as A + +interface I +class A : I +class B : I + +fun case3(){ + A() + ; typeCall: function")!>A() + + A.invoke() + A.invoke() + + B() + ; typeCall: function")!>B() +} + +// FILE: Lib.kt +package lib.case3 + +//fun B() : String = "" + +object B { + /*operator*/ fun invoke() : Int = 1 +} 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.6.fir.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.6.fir.kt new file mode 100644 index 00000000000..385fe9df188 --- /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.6.fir.kt @@ -0,0 +1,122 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION +// SKIP_TXT + + +// FILE: TestCase1.kt +// TESTCASE NUMBER: 1 + +package tests.case1 + +import lib.case1.b.C as B +import lib.case1.a.C as A + +interface I +class A : I +class B : I + +fun case1(){ + A() + A() + + B() + B() +} + +// FILE: Lib.kt +package lib.case1.a + +fun C() : String = "" + +object C { + operator fun invoke() : Int = 1 +} + +// FILE: Lib.kt +package lib.case1.b + +fun C() : String = "" + +object C { + operator fun invoke() : Int = 1 +} + +// FILE: TestCase2.kt +// TESTCASE NUMBER: 2 + +package tests.case2 + +import lib.case2.a.C as A +import lib.case2.b.C as B + +interface I +class A : I +class B : I + +fun case2(){ + A() + A() + + B() + B() +} + +// FILE: Lib.kt +package lib.case2.a + +//fun C() : String = "" + +object C { + operator fun invoke() : Int = 1 +} +// FILE: Lib.kt +package lib.case2.b + +//fun C() : String = "" + +object C { + operator fun invoke() : Int = 1 +} + +// FILE: TestCase3.kt +// TESTCASE NUMBER: 3 + +package tests.case3 + +import lib.case3.b.C as B +import lib.case3.a.C as A + +interface I +class A : I +class B : I + +fun case3(){ + A() + A() + + A.invoke() + A.invoke() + + B() + B() + + B.invoke() + B.invoke() +} + +// FILE: Lib.kt +package lib.case3.a + +//fun B() : String = "" + +object C { + /*operator*/ fun invoke() : Int = 1 +} +// FILE: Lib.kt +package lib.case3.b + +//fun C() : String = "" + +object C { + /*operator*/ fun invoke() : Int = 1 +} 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.6.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.6.kt new file mode 100644 index 00000000000..e3e1f1c872c --- /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.6.kt @@ -0,0 +1,132 @@ +// !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-464 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 5 -> sentence 4 + * PRIMARY LINKS: overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 5 -> sentence 5 + * declarations, type-alias -> paragraph 1 -> sentence 1 + * NUMBER: 6 + * DESCRIPTION: Top-level non-extension functions named f: callables explicitly imported into the current file; + */ + +// FILE: TestCase1.kt +// TESTCASE NUMBER: 1 + +package tests.case1 + +import lib.case1.b.C as B +import lib.case1.a.C as A + +interface I +class A : I +class B : I + +fun case1(){ + A() + A() + + B() + B() +} + +// FILE: Lib.kt +package lib.case1.a + +fun C() : String = "" + +object C { + operator fun invoke() : Int = 1 +} + +// FILE: Lib.kt +package lib.case1.b + +fun C() : String = "" + +object C { + operator fun invoke() : Int = 1 +} + +// FILE: TestCase2.kt +// TESTCASE NUMBER: 2 + +package tests.case2 + +import lib.case2.a.C as A +import lib.case2.b.C as B + +interface I +class A : I +class B : I + +fun case2(){ + A() + A() + + B() + B() +} + +// FILE: Lib.kt +package lib.case2.a + +//fun C() : String = "" + +object C { + operator fun invoke() : Int = 1 +} +// FILE: Lib.kt +package lib.case2.b + +//fun C() : String = "" + +object C { + operator fun invoke() : Int = 1 +} + +// FILE: TestCase3.kt +// TESTCASE NUMBER: 3 + +package tests.case3 + +import lib.case3.b.C as B +import lib.case3.a.C as A + +interface I +class A : I +class B : I + +fun case3(){ + A() + ; typeCall: function")!>A() + + A.invoke() + A.invoke() + + B() + ; typeCall: function")!>B() + + B.invoke() + B.invoke() +} + +// FILE: Lib.kt +package lib.case3.a + +//fun B() : String = "" + +object C { + /*operator*/ fun invoke() : Int = 1 +} +// FILE: Lib.kt +package lib.case3.b + +//fun C() : String = "" + +object C { + /*operator*/ fun invoke() : Int = 1 +} 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 index 629f5931c99..7305e81af5e 100644 --- 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 @@ -27,7 +27,33 @@ "linkType": "main" } ], + "4": [ + { + "specVersion": "0.1-464", + "casesNumber": 1, + "description": "Top-level non-extension functions named f: callables implicitly 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/neg/4.1.kt", + "unexpectedBehaviour": false, + "linkType": "main" + }, + { + "specVersion": "0.1-464", + "casesNumber": 1, + "description": "Top-level non-extension functions named f: callables implicitly 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/neg/4.2.kt", + "unexpectedBehaviour": false, + "linkType": "main" + } + ], "6": [ + { + "specVersion": "0.1-464", + "casesNumber": 1, + "description": "Top-level non-extension functions named f: callables implicitly 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/neg/4.1.kt", + "unexpectedBehaviour": false, + "linkType": "primary" + }, { "specVersion": "0.1-401", "casesNumber": 5, @@ -43,6 +69,14 @@ "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/6.4.kt", "unexpectedBehaviour": true, "linkType": "main" + }, + { + "specVersion": "0.1-464", + "casesNumber": 1, + "description": "Top-level non-extension functions named f: callables implicitly 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/neg/4.2.kt", + "unexpectedBehaviour": false, + "linkType": "primary" } ] }, @@ -130,6 +164,22 @@ "unexpectedBehaviour": true, "linkType": "main" }, + { + "specVersion": "0.1-464", + "casesNumber": 3, + "description": "Top-level non-extension functions named f: callables implicitly 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.4.kt", + "unexpectedBehaviour": false, + "linkType": "primary" + }, + { + "specVersion": "0.1-464", + "casesNumber": 3, + "description": "Top-level non-extension functions named f: callables implicitly 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.3.kt", + "unexpectedBehaviour": false, + "linkType": "primary" + }, { "specVersion": "0.1-278", "casesNumber": 3, @@ -140,6 +190,14 @@ } ], "4": [ + { + "specVersion": "0.1-464", + "casesNumber": 3, + "description": "Top-level non-extension functions named f: 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.5.kt", + "unexpectedBehaviour": false, + "linkType": "main" + }, { "specVersion": "0.1-278", "casesNumber": 3, @@ -147,9 +205,49 @@ "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, "linkType": "main" + }, + { + "specVersion": "0.1-464", + "casesNumber": 3, + "description": "Top-level non-extension functions named f: callables implicitly 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.4.kt", + "unexpectedBehaviour": false, + "linkType": "main" + }, + { + "specVersion": "0.1-464", + "casesNumber": 3, + "description": "Top-level non-extension functions named f: callables implicitly 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.3.kt", + "unexpectedBehaviour": false, + "linkType": "main" + }, + { + "specVersion": "0.1-464", + "casesNumber": 3, + "description": "Top-level non-extension functions named f: 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.6.kt", + "unexpectedBehaviour": false, + "linkType": "main" + }, + { + "specVersion": "0.1-464", + "casesNumber": 3, + "description": "Top-level non-extension functions named f: 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.2.kt", + "unexpectedBehaviour": false, + "linkType": "main" } ], "5": [ + { + "specVersion": "0.1-464", + "casesNumber": 3, + "description": "Top-level non-extension functions named f: 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.5.kt", + "unexpectedBehaviour": false, + "linkType": "primary" + }, { "specVersion": "0.1-278", "casesNumber": 3, @@ -157,6 +255,22 @@ "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, "linkType": "main" + }, + { + "specVersion": "0.1-464", + "casesNumber": 3, + "description": "Top-level non-extension functions named f: 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.6.kt", + "unexpectedBehaviour": false, + "linkType": "primary" + }, + { + "specVersion": "0.1-464", + "casesNumber": 3, + "description": "Top-level non-extension functions named f: 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.2.kt", + "unexpectedBehaviour": false, + "linkType": "primary" } ], "7": [ 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 2f2412cf688..b57c817ce47 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 @@ -25,7 +25,7 @@ public class DiagnosticsTestSpecGenerated extends AbstractDiagnosticsTestSpec { } public void testAllFilesPresentInDiagnostics() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "helpers", "linked/annotations", "linked/built-in-types-and-their-semantics", "linked/control--and-data-flow-analysis.control-flow-graph.expressions-1.conditional-expressions", "linked/control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph", "linked/declarations/classifier-declaration/classifier-initialization", "linked/declarations/function-declaration", "linked/declarations/property-declaration/property-initialization", "linked/expressions/call-and-property-access-expressions", "linked/expressions/function-literals", "linked/inheritance", "linked/overload-resolution/c-level-partition", "linked/overload-resolution/determining-function-applicability-for-a-specific-call/rationale", "linked/overloadable-operators", "linked/statements/assignments/simple-assignments", "linked/type-inference/local-type-inference", "linked/type-inference/smart-casts/smart-cast-types", "linked/type-system/subtyping/subtyping-for-nullable-types", "linked/type-system/type-kinds/type-parameters"); + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "helpers", "linked/annotations", "linked/built-in-types-and-their-semantics", "linked/control--and-data-flow-analysis.control-flow-graph.expressions-1.conditional-expressions", "linked/control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph", "linked/declarations/classifier-declaration/classifier-initialization", "linked/declarations/function-declaration", "linked/declarations/property-declaration/property-initialization", "linked/declarations/type-alias", "linked/expressions/call-and-property-access-expressions", "linked/expressions/function-literals", "linked/inheritance", "linked/overload-resolution/c-level-partition", "linked/overload-resolution/determining-function-applicability-for-a-specific-call/rationale", "linked/overloadable-operators", "linked/statements/assignments/simple-assignments", "linked/type-inference/local-type-inference", "linked/type-inference/smart-casts/smart-cast-types", "linked/type-system/subtyping/subtyping-for-nullable-types", "linked/type-system/type-kinds/type-parameters"); } @TestMetadata("compiler/tests-spec/testData/diagnostics/linked") @@ -37,7 +37,7 @@ public class DiagnosticsTestSpecGenerated extends AbstractDiagnosticsTestSpec { } public void testAllFilesPresentInLinked() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "annotations", "built-in-types-and-their-semantics", "control--and-data-flow-analysis.control-flow-graph.expressions-1.conditional-expressions", "control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph", "declarations/classifier-declaration/classifier-initialization", "declarations/function-declaration", "declarations/property-declaration/property-initialization", "expressions/call-and-property-access-expressions", "expressions/function-literals", "inheritance", "overload-resolution/c-level-partition", "overload-resolution/determining-function-applicability-for-a-specific-call/rationale", "overloadable-operators", "statements/assignments/simple-assignments", "type-inference/local-type-inference", "type-inference/smart-casts/smart-cast-types", "type-system/subtyping/subtyping-for-nullable-types", "type-system/type-kinds/type-parameters"); + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "annotations", "built-in-types-and-their-semantics", "control--and-data-flow-analysis.control-flow-graph.expressions-1.conditional-expressions", "control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph", "declarations/classifier-declaration/classifier-initialization", "declarations/function-declaration", "declarations/property-declaration/property-initialization", "declarations/type-alias", "expressions/call-and-property-access-expressions", "expressions/function-literals", "inheritance", "overload-resolution/c-level-partition", "overload-resolution/determining-function-applicability-for-a-specific-call/rationale", "overloadable-operators", "statements/assignments/simple-assignments", "type-inference/local-type-inference", "type-inference/smart-casts/smart-cast-types", "type-system/subtyping/subtyping-for-nullable-types", "type-system/type-kinds/type-parameters"); } @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis") @@ -180,7 +180,7 @@ public class DiagnosticsTestSpecGenerated extends AbstractDiagnosticsTestSpec { } public void testAllFilesPresentInDeclarations() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "classifier-declaration/classifier-initialization", "function-declaration", "property-declaration/property-initialization"); + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "classifier-declaration/classifier-initialization", "function-declaration", "property-declaration/property-initialization", "type-alias"); } @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration") @@ -3946,6 +3946,16 @@ public class DiagnosticsTestSpecGenerated extends AbstractDiagnosticsTestSpec { 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"); } + @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/neg/4.1.kt"); + } + + @TestMetadata("4.2.kt") + public void test4_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/neg/4.2.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/neg/6.1.kt"); @@ -3999,6 +4009,31 @@ public class DiagnosticsTestSpecGenerated extends AbstractDiagnosticsTestSpec { 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("4.2.kt") + public void test4_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/4.2.kt"); + } + + @TestMetadata("4.3.kt") + public void test4_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/4.3.kt"); + } + + @TestMetadata("4.4.kt") + public void test4_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/4.4.kt"); + } + + @TestMetadata("4.5.kt") + public void test4_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/4.5.kt"); + } + + @TestMetadata("4.6.kt") + public void test4_6() 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.6.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"); diff --git a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/checkers/FirDiagnosticsTestSpecGenerated.java b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/checkers/FirDiagnosticsTestSpecGenerated.java index 403cde682a2..a947b9f8d78 100644 --- a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/checkers/FirDiagnosticsTestSpecGenerated.java +++ b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/checkers/FirDiagnosticsTestSpecGenerated.java @@ -25,7 +25,7 @@ public class FirDiagnosticsTestSpecGenerated extends AbstractFirDiagnosticsTestS } public void testAllFilesPresentInDiagnostics() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "helpers", "linked/annotations", "linked/built-in-types-and-their-semantics", "linked/control--and-data-flow-analysis.control-flow-graph.expressions-1.conditional-expressions", "linked/control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph", "linked/declarations/classifier-declaration/classifier-initialization", "linked/declarations/function-declaration", "linked/declarations/property-declaration/property-initialization", "linked/expressions/call-and-property-access-expressions", "linked/expressions/function-literals", "linked/inheritance", "linked/overload-resolution/c-level-partition", "linked/overload-resolution/determining-function-applicability-for-a-specific-call/rationale", "linked/overloadable-operators", "linked/statements/assignments/simple-assignments", "linked/type-inference/local-type-inference", "linked/type-inference/smart-casts/smart-cast-types", "linked/type-system/subtyping/subtyping-for-nullable-types", "linked/type-system/type-kinds/type-parameters"); + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "helpers", "linked/annotations", "linked/built-in-types-and-their-semantics", "linked/control--and-data-flow-analysis.control-flow-graph.expressions-1.conditional-expressions", "linked/control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph", "linked/declarations/classifier-declaration/classifier-initialization", "linked/declarations/function-declaration", "linked/declarations/property-declaration/property-initialization", "linked/declarations/type-alias", "linked/expressions/call-and-property-access-expressions", "linked/expressions/function-literals", "linked/inheritance", "linked/overload-resolution/c-level-partition", "linked/overload-resolution/determining-function-applicability-for-a-specific-call/rationale", "linked/overloadable-operators", "linked/statements/assignments/simple-assignments", "linked/type-inference/local-type-inference", "linked/type-inference/smart-casts/smart-cast-types", "linked/type-system/subtyping/subtyping-for-nullable-types", "linked/type-system/type-kinds/type-parameters"); } @TestMetadata("compiler/tests-spec/testData/diagnostics/linked") @@ -37,7 +37,7 @@ public class FirDiagnosticsTestSpecGenerated extends AbstractFirDiagnosticsTestS } public void testAllFilesPresentInLinked() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "annotations", "built-in-types-and-their-semantics", "control--and-data-flow-analysis.control-flow-graph.expressions-1.conditional-expressions", "control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph", "declarations/classifier-declaration/classifier-initialization", "declarations/function-declaration", "declarations/property-declaration/property-initialization", "expressions/call-and-property-access-expressions", "expressions/function-literals", "inheritance", "overload-resolution/c-level-partition", "overload-resolution/determining-function-applicability-for-a-specific-call/rationale", "overloadable-operators", "statements/assignments/simple-assignments", "type-inference/local-type-inference", "type-inference/smart-casts/smart-cast-types", "type-system/subtyping/subtyping-for-nullable-types", "type-system/type-kinds/type-parameters"); + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "annotations", "built-in-types-and-their-semantics", "control--and-data-flow-analysis.control-flow-graph.expressions-1.conditional-expressions", "control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph", "declarations/classifier-declaration/classifier-initialization", "declarations/function-declaration", "declarations/property-declaration/property-initialization", "declarations/type-alias", "expressions/call-and-property-access-expressions", "expressions/function-literals", "inheritance", "overload-resolution/c-level-partition", "overload-resolution/determining-function-applicability-for-a-specific-call/rationale", "overloadable-operators", "statements/assignments/simple-assignments", "type-inference/local-type-inference", "type-inference/smart-casts/smart-cast-types", "type-system/subtyping/subtyping-for-nullable-types", "type-system/type-kinds/type-parameters"); } @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis") @@ -180,7 +180,7 @@ public class FirDiagnosticsTestSpecGenerated extends AbstractFirDiagnosticsTestS } public void testAllFilesPresentInDeclarations() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "classifier-declaration/classifier-initialization", "function-declaration", "property-declaration/property-initialization"); + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "classifier-declaration/classifier-initialization", "function-declaration", "property-declaration/property-initialization", "type-alias"); } @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration") @@ -3946,6 +3946,16 @@ public class FirDiagnosticsTestSpecGenerated extends AbstractFirDiagnosticsTestS 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"); } + @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/neg/4.1.kt"); + } + + @TestMetadata("4.2.kt") + public void test4_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/neg/4.2.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/neg/6.1.kt"); @@ -3999,6 +4009,31 @@ public class FirDiagnosticsTestSpecGenerated extends AbstractFirDiagnosticsTestS 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("4.2.kt") + public void test4_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/4.2.kt"); + } + + @TestMetadata("4.3.kt") + public void test4_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/4.3.kt"); + } + + @TestMetadata("4.4.kt") + public void test4_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/4.4.kt"); + } + + @TestMetadata("4.5.kt") + public void test4_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/4.5.kt"); + } + + @TestMetadata("4.6.kt") + public void test4_6() 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.6.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");