From d5ddb26180cb08bf7a186136a962e6b2269dcfb0 Mon Sep 17 00:00:00 2001 From: "anastasiia.spaseeva" Date: Tue, 28 Jul 2020 11:14:26 +0300 Subject: [PATCH] [Spec tests] Add overload resolution tests for plus assign operator call --- .../box/linked/operator-call/testsMap.json | 44 ++ .../p-1/neg/2.1.exceptions.compiletime.txt | 1 + .../operator-call/p-1/neg/2.1.kt | 61 +++ .../p-1/neg/2.2.exceptions.compiletime.txt | 1 + .../operator-call/p-1/neg/2.2.kt | 61 +++ .../p-1/neg/2.3.exceptions.compiletime.txt | 1 + .../operator-call/p-1/neg/2.3.kt | 61 +++ .../p-1/neg/2.4.exceptions.compiletime.txt | 1 + .../operator-call/p-1/neg/2.4.kt | 61 +++ .../p-1/neg/2.5.exceptions.compiletime.txt | 1 + .../operator-call/p-1/neg/2.5.kt | 61 +++ .../p-1/neg/2.6.exceptions.compiletime.txt | 1 + .../operator-call/p-1/neg/2.6.kt | 61 +++ .../operator-call/p-1/pos/2.1.kt | 61 +++ .../operator-call/p-1/pos/2.10.kt | 64 +++ .../operator-call/p-1/pos/2.2.kt | 62 +++ .../operator-call/p-1/pos/2.3.kt | 61 +++ .../operator-call/p-1/pos/2.4.kt | 73 ++++ .../operator-call/p-1/pos/2.5.kt | 61 +++ .../operator-call/p-1/pos/2.6.kt | 62 +++ .../operator-call/p-1/pos/2.7.kt | 61 +++ .../operator-call/p-1/pos/2.8.kt | 73 ++++ .../operator-call/p-1/pos/2.9.kt | 64 +++ .../operator-call/testsMap.json | 138 +++++++ .../algorithm-of-msc-selection/testsMap.json | 84 ++++ .../operator-assignments/testsMap.json | 384 ++++++++++++++++++ .../operator-call/p-1/neg/2.1.fir.kt | 47 +++ .../operator-call/p-1/neg/2.1.kt | 56 +++ .../operator-call/p-1/neg/2.2.fir.kt | 27 ++ .../operator-call/p-1/neg/2.2.kt | 36 ++ .../operator-call/p-1/neg/2.4.fir.kt | 42 ++ .../operator-call/p-1/neg/2.4.kt | 90 ++++ .../operator-call/p-1/neg/2.5.fir.kt | 39 ++ .../operator-call/p-1/neg/2.5.kt | 50 +++ .../operator-call/p-1/neg/2.6.fir.kt | 42 ++ .../operator-call/p-1/neg/2.6.kt | 53 +++ .../operator-call/p-1/neg/2.7.fir.kt | 42 ++ .../operator-call/p-1/neg/2.7.kt | 53 +++ .../operator-call/p-1/neg/2.8.fir.kt | 73 ++++ .../operator-call/p-1/neg/2.8.kt | 84 ++++ .../operator-call/p-1/neg/2.9.fir.kt | 37 ++ .../operator-call/p-1/neg/2.9.kt | 47 +++ .../operator-call/p-1/pos/2.1.fir.kt | 120 ++++++ .../operator-call/p-1/pos/2.1.kt | 131 ++++++ .../operator-call/p-1/pos/2.2.fir.kt | 36 ++ .../operator-call/p-1/pos/2.2.kt | 47 +++ .../operator-call/p-2/pos/3.1.kt | 1 + .../operator-call/testsMap.json | 90 ++++ .../p-9/neg/2.2.fir.kt | 75 ++++ .../algorithm-of-msc-selection/p-9/neg/2.2.kt | 83 ++++ .../algorithm-of-msc-selection/testsMap.json | 80 ++++ .../description/p-2/neg/2.1.fir.kt | 39 ++ .../description/p-2/neg/2.1.kt | 49 +++ .../description/testsMap.json | 68 ++++ .../p-1/neg/1.1.kt | 2 + .../operator-assignments/testsMap.json | 24 ++ .../DiagnosticsTestSpecGenerated.java | 157 ++++++- .../FirDiagnosticsTestSpecGenerated.java | 157 ++++++- .../BlackBoxCodegenTestSpecGenerated.java | 123 +++++- 59 files changed, 3756 insertions(+), 8 deletions(-) create mode 100644 compiler/tests-spec/testData/codegen/box/linked/operator-call/testsMap.json create mode 100644 compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.1.exceptions.compiletime.txt create mode 100644 compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.1.kt create mode 100644 compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.2.exceptions.compiletime.txt create mode 100644 compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.2.kt create mode 100644 compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.3.exceptions.compiletime.txt create mode 100644 compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.3.kt create mode 100644 compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.4.exceptions.compiletime.txt create mode 100644 compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.4.kt create mode 100644 compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.5.exceptions.compiletime.txt create mode 100644 compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.5.kt create mode 100644 compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.6.exceptions.compiletime.txt create mode 100644 compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.6.kt create mode 100644 compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.1.kt create mode 100644 compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.10.kt create mode 100644 compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.2.kt create mode 100644 compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.3.kt create mode 100644 compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.4.kt create mode 100644 compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.5.kt create mode 100644 compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.6.kt create mode 100644 compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.7.kt create mode 100644 compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.8.kt create mode 100644 compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.9.kt create mode 100644 compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.1.fir.kt create mode 100644 compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.1.kt create mode 100644 compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.2.fir.kt create mode 100644 compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.2.kt create mode 100644 compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.4.fir.kt create mode 100644 compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.4.kt create mode 100644 compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.5.fir.kt create mode 100644 compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.5.kt create mode 100644 compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.6.fir.kt create mode 100644 compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.6.kt create mode 100644 compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.7.fir.kt create mode 100644 compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.7.kt create mode 100644 compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.8.fir.kt create mode 100644 compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.8.kt create mode 100644 compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.9.fir.kt create mode 100644 compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.9.kt create mode 100644 compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.1.fir.kt create mode 100644 compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.1.kt create mode 100644 compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.2.fir.kt create mode 100644 compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.2.kt create mode 100644 compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.2.fir.kt create mode 100644 compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.2.kt create mode 100644 compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/p-2/neg/2.1.fir.kt create mode 100644 compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/p-2/neg/2.1.kt diff --git a/compiler/tests-spec/testData/codegen/box/linked/operator-call/testsMap.json b/compiler/tests-spec/testData/codegen/box/linked/operator-call/testsMap.json new file mode 100644 index 00000000000..7ecd248ad41 --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/operator-call/testsMap.json @@ -0,0 +1,44 @@ +{ + "1": { + "neg": { + "2": [ + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and infix functions", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.5.kt", + "unexpectedBehaviour": false, + "linkType": "main" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and infix functions", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.6.kt", + "unexpectedBehaviour": false, + "linkType": "main" + } + ] + }, + "pos": { + "2": [ + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and infix functions", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.5.kt", + "unexpectedBehaviour": false, + "linkType": "main" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and infix functions", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.6.kt", + "unexpectedBehaviour": false, + "linkType": "main" + } + ] + } + } +} \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.1.exceptions.compiletime.txt b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.1.exceptions.compiletime.txt new file mode 100644 index 00000000000..3fac1a9076d --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.1.exceptions.compiletime.txt @@ -0,0 +1 @@ +java.lang.IllegalStateException: UNSAFE_OPERATOR_CALL: Operator call corresponds to a dot-qualified call 'a?.b.plusAssign(c)' which is not allowed on a nullable receiver 'a?.b'. (20,10) in /2.1.kt \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.1.kt b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.1.kt new file mode 100644 index 00000000000..fbf87111de1 --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.1.kt @@ -0,0 +1,61 @@ +// WITH_RUNTIME + +/* + * KOTLIN CODEGEN BOX SPEC TEST (NEGATIVE) + * + * SPEC VERSION: 0.1-488 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2 + * SECONDARY LINKS: statements, assignments, operator-assignments -> paragraph 2 -> sentence 1 + * statements, assignments, operator-assignments -> paragraph 2 -> sentence 2 + * statements, assignments, operator-assignments -> paragraph 2 -> sentence 3 + * NUMBER: 1 + * DESCRIPTION: nullable receiver + * EXCEPTION: compiletime + */ + +fun box(): String { + val a: A? = A(B()) + val c: C = C() + + a?.b += c + if (f3 && !f1 && !f2 && !f4) { + f3 = false + a?.b.plusAssign(c) + if (f3 && !f1 && !f2 && !f4) + return "OK" + } + return "NOK" +} + +class A(val b: B) + +var f1 = false +var f2 = false +var f3 = false +var f4 = false + +class B { + operator fun plusAssign(c: C) { + f1 = true + print("1") + } + + operator fun plus(c: C): C { + f2 = true + print("2") + return c + } +} + +operator fun B.plusAssign(c: C) { + f3 = true + print("3") +} + +operator fun B.plusAssign(c: Any) { + f4 = true + print("4") +} + + +class C \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.2.exceptions.compiletime.txt b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.2.exceptions.compiletime.txt new file mode 100644 index 00000000000..80bfc6cebcd --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.2.exceptions.compiletime.txt @@ -0,0 +1 @@ +java.lang.IllegalStateException: UNSAFE_OPERATOR_CALL: Operator call corresponds to a dot-qualified call 'a?.b.plusAssign({ c }())' which is not allowed on a nullable receiver 'a?.b'. (20,10) in /2.2.kt \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.2.kt b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.2.kt new file mode 100644 index 00000000000..0fe261a346b --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.2.kt @@ -0,0 +1,61 @@ +// WITH_RUNTIME + +/* + * KOTLIN CODEGEN BOX SPEC TEST (NEGATIVE) + * + * SPEC VERSION: 0.1-488 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2 + * SECONDARY LINKS: statements, assignments, operator-assignments -> paragraph 2 -> sentence 1 + * statements, assignments, operator-assignments -> paragraph 2 -> sentence 2 + * statements, assignments, operator-assignments -> paragraph 2 -> sentence 3 + * NUMBER: 2 + * DESCRIPTION: nullable receiver + * EXCEPTION: compiletime + */ + +fun box(): String { + val a: A? = A(B()) + val c: C = C() + + a?.b += { c }() + if (f3 && !f1 && !f2 && !f4) { + f3 = false + a?.b.plusAssign({ c }()) + if (f3 && !f1 && !f2 && !f4) + return "OK" + } + return "NOK" +} + +class A(val b: B) + +var f1 = false +var f2 = false +var f3 = false +var f4 = false + +class B { + operator fun plusAssign(c: C) { + f1 = true + print("1") + } + + operator fun plus(c: C): C { + f2 = true + print("2") + return c + } +} + +operator fun B.plusAssign(c: C) { + f3 = true + print("3") +} + +operator fun B.plusAssign(c: Any) { + f4 = true + print("4") +} + + +class C \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.3.exceptions.compiletime.txt b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.3.exceptions.compiletime.txt new file mode 100644 index 00000000000..2f87e48344c --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.3.exceptions.compiletime.txt @@ -0,0 +1 @@ +java.lang.IllegalStateException: UNSAFE_OPERATOR_CALL: Operator call corresponds to a dot-qualified call 'a?.b.plusAssign(c)' which is not allowed on a nullable receiver 'a?.b'. (20,10) in /2.3.kt \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.3.kt b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.3.kt new file mode 100644 index 00000000000..b03d4100110 --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.3.kt @@ -0,0 +1,61 @@ +// WITH_RUNTIME + +/* + * KOTLIN CODEGEN BOX SPEC TEST (NEGATIVE) + * + * SPEC VERSION: 0.1-488 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2 + * SECONDARY LINKS: statements, assignments, operator-assignments -> paragraph 2 -> sentence 1 + * statements, assignments, operator-assignments -> paragraph 2 -> sentence 2 + * statements, assignments, operator-assignments -> paragraph 2 -> sentence 3 + * NUMBER: 3 + * DESCRIPTION: nullable receiver + * EXCEPTION: compiletime + */ + +fun box(): String { + val a: A? = A(B()) + val c: C? = C() + + a?.b += c + if (f3 && !f1 && !f2 && !f4) { + f3 = false + a?.b.plusAssign(c) + if (f3 && !f1 && !f2 && !f4) + return "OK" + } + return "NOK" +} + +class A(val b: B) + +var f1 = false +var f2 = false +var f3 = false +var f4 = false + +class B { + operator fun plusAssign(c: C) { + f1 = true + print("1") + } + + operator fun plus(c: C): C { + f2 = true + print("2") + return c + } +} + +operator fun B.plusAssign(c: C) { + f3 = true + print("3") +} + +operator fun B.plusAssign(c: Any) { + f4 = true + print("4") +} + + +class C \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.4.exceptions.compiletime.txt b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.4.exceptions.compiletime.txt new file mode 100644 index 00000000000..5a98b51039d --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.4.exceptions.compiletime.txt @@ -0,0 +1 @@ +java.lang.IllegalStateException: UNSAFE_OPERATOR_CALL: Operator call corresponds to a dot-qualified call 'a?.b.plusAssign(c)' which is not allowed on a nullable receiver 'a?.b'. (20,10) in /2.4.kt diff --git a/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.4.kt b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.4.kt new file mode 100644 index 00000000000..d582d906eca --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.4.kt @@ -0,0 +1,61 @@ +// WITH_RUNTIME + +/* + * KOTLIN CODEGEN BOX SPEC TEST (NEGATIVE) + * + * SPEC VERSION: 0.1-488 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2 + * SECONDARY LINKS: statements, assignments, operator-assignments -> paragraph 2 -> sentence 1 + * statements, assignments, operator-assignments -> paragraph 2 -> sentence 2 + * statements, assignments, operator-assignments -> paragraph 2 -> sentence 3 + * NUMBER: 4 + * DESCRIPTION: nullable receiver and infix functions + * EXCEPTION: compiletime + */ + +fun box(): String { + val a: A? = A(B()) + val c: C = C() + + a?.b += c + if (f3 && !f1 && !f2 && !f4) { + f3 = false + a?.b plusAssign c + if (f3 && !f1 && !f2 && !f4) + return "OK" + } + return "NOK" +} + +class A(val b: B) + +var f1 = false +var f2 = false +var f3 = false +var f4 = false + +class B { + infix operator fun plusAssign(c: C) { + f1 = true + print("1") + } + + infix operator fun plus(c: C): C { + f2 = true + print("2") + return c + } +} + +infix operator fun B.plusAssign(c: C) { + f3 = true + print("3") +} + +infix operator fun B.plusAssign(c: Any) { + f4 = true + print("4") +} + + +class C \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.5.exceptions.compiletime.txt b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.5.exceptions.compiletime.txt new file mode 100644 index 00000000000..9653826983b --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.5.exceptions.compiletime.txt @@ -0,0 +1 @@ +java.lang.IllegalStateException: UNSAFE_OPERATOR_CALL: Operator call corresponds to a dot-qualified call 'a?.b.plusAssign({ c }())' which is not allowed on a nullable receiver 'a?.b'. (20,10) in /2.5.kt diff --git a/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.5.kt b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.5.kt new file mode 100644 index 00000000000..2bdcc74e80e --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.5.kt @@ -0,0 +1,61 @@ +// WITH_RUNTIME + +/* + * KOTLIN CODEGEN BOX SPEC TEST (NEGATIVE) + * + * SPEC VERSION: 0.1-488 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2 + * SECONDARY LINKS: statements, assignments, operator-assignments -> paragraph 2 -> sentence 1 + * statements, assignments, operator-assignments -> paragraph 2 -> sentence 2 + * statements, assignments, operator-assignments -> paragraph 2 -> sentence 3 + * NUMBER: 5 + * DESCRIPTION: nullable receiver and infix functions + * EXCEPTION: compiletime + */ + +fun box(): String { + val a: A? = A(B()) + val c: C = C() + + a?.b += { c }() + if (f3 && !f1 && !f2 && !f4) { + f3 = false + a?.b plusAssign { c }() + if (f3 && !f1 && !f2 && !f4) + return "OK" + } + return "NOK" +} + +class A(val b: B) + +var f1 = false +var f2 = false +var f3 = false +var f4 = false + +class B { + infix operator fun plusAssign(c: C) { + f1 = true + print("1") + } + + infix operator fun plus(c: C): C { + f2 = true + print("2") + return c + } +} + +infix operator fun B.plusAssign(c: C) { + f3 = true + print("3") +} + +infix operator fun B.plusAssign(c: Any) { + f4 = true + print("4") +} + + +class C \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.6.exceptions.compiletime.txt b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.6.exceptions.compiletime.txt new file mode 100644 index 00000000000..d5719618ac2 --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.6.exceptions.compiletime.txt @@ -0,0 +1 @@ +java.lang.IllegalStateException: UNSAFE_OPERATOR_CALL: Operator call corresponds to a dot-qualified call 'a?.b.plusAssign(c)' which is not allowed on a nullable receiver 'a?.b'. (20,10) in /2.6.kt diff --git a/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.6.kt b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.6.kt new file mode 100644 index 00000000000..835fb459862 --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.6.kt @@ -0,0 +1,61 @@ +// WITH_RUNTIME + +/* + * KOTLIN CODEGEN BOX SPEC TEST (NEGATIVE) + * + * SPEC VERSION: 0.1-488 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2 + * SECONDARY LINKS: statements, assignments, operator-assignments -> paragraph 2 -> sentence 1 + * statements, assignments, operator-assignments -> paragraph 2 -> sentence 2 + * statements, assignments, operator-assignments -> paragraph 2 -> sentence 3 + * NUMBER: 6 + * DESCRIPTION: nullable receiver and infix functions + * EXCEPTION: compiletime + */ + +fun box(): String { + val a: A? = A(B()) + val c: C? = C() + + a?.b += c + if (f3 && !f1 && !f2 && !f4) { + f3 = false + a?.b plusAssign c + if (f3 && !f1 && !f2 && !f4) + return "OK" + } + return "NOK" +} + +class A(val b: B) + +var f1 = false +var f2 = false +var f3 = false +var f4 = false + +class B { + infix operator fun plusAssign(c: C) { + f1 = true + print("1") + } + + infix operator fun plus(c: C): C { + f2 = true + print("2") + return c + } +} + +infix operator fun B.plusAssign(c: C) { + f3 = true + print("3") +} + +infix operator fun B.plusAssign(c: Any) { + f4 = true + print("4") +} + + +class C \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.1.kt b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.1.kt new file mode 100644 index 00000000000..6b3451b9d3f --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.1.kt @@ -0,0 +1,61 @@ +// WITH_RUNTIME + +/* + * KOTLIN CODEGEN BOX SPEC TEST (POSITIVE) + * + * SPEC VERSION: 0.1-488 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2 + * PRIMARY LINKS: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 3 -> sentence 3 + * SECONDARY LINKS: statements, assignments, operator-assignments -> paragraph 2 -> sentence 1 + * statements, assignments, operator-assignments -> paragraph 2 -> sentence 2 + * statements, assignments, operator-assignments -> paragraph 2 -> sentence 3 + * NUMBER: 1 + * DESCRIPTION: nullable receiver + */ + +fun box(): String { + val a: A? = A(B()) + val c: C = C() + + a?.b += c + if (f3 && !f1 && !f2 && !f4) { + f3 = false + a?.b.plusAssign(c) + if (f3 && !f1 && !f2 && !f4) + return "OK" + } + return "NOK" +} + +class A(val b: B) + +var f1 = false +var f2 = false +var f3 = false +var f4 = false + +class B { + operator fun plusAssign(c: C) { + f1 = true + print("1") + } + + operator fun plus(c: C): C { + f2 = true + print("2") + return c + } +} + +operator fun B?.plusAssign(c: C) { + f3 = true + print("3") +} + +operator fun B?.plusAssign(c: Any) { + f4 = true + print("4") +} + + +class C \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.10.kt b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.10.kt new file mode 100644 index 00000000000..aace0102b54 --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.10.kt @@ -0,0 +1,64 @@ +// WITH_RUNTIME + +/* + * KOTLIN CODEGEN BOX SPEC TEST (POSITIVE) + * + * SPEC VERSION: 0.1-488 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2 + * PRIMARY LINKS: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 3 -> sentence 3 + * SECONDARY LINKS: statements, assignments, operator-assignments -> paragraph 2 -> sentence 1 + * statements, assignments, operator-assignments -> paragraph 2 -> sentence 2 + * statements, assignments, operator-assignments -> paragraph 2 -> sentence 3 + * NUMBER: 10 + * DESCRIPTION: nullable receiver and inline operator function + */ + + +fun cc() : C = C() +fun box(): String { + val a: A? = A(B()) + + a!!.b += ::cc + if (!f3 && f1 && !f2 && !f4) { + f1 = false + a!!.b.plusAssign(::cc) + if (f1 && !f3 && !f2 && !f4) + return "OK" + } + return "NOK" +} + +class A(val b: B) + +var f1 = false +var f2 = false +var f3 = false +var f4 = false + + +class B { + inline operator fun plusAssign(c: ()->C) { + f1 = true + print("1") + } + + inline operator fun plus(c: ()->C): C { + f2 = true + print("2") + return c() + } +} + +@JvmName("aa") +inline operator fun B?.plusAssign(c: ()->C) { + f3 = true + print("3") +} +@JvmName("bb") +inline operator fun B?.plusAssign(c: ()->Any) { + f4 = true + print("4") +} + + +class C \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.2.kt b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.2.kt new file mode 100644 index 00000000000..c2653d848e6 --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.2.kt @@ -0,0 +1,62 @@ +// WITH_RUNTIME + +/* + * KOTLIN CODEGEN BOX SPEC TEST (POSITIVE) + * + * SPEC VERSION: 0.1-488 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2 + * PRIMARY LINKS: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 3 -> sentence 3 + * SECONDARY LINKS: statements, assignments, operator-assignments -> paragraph 2 -> sentence 1 + * statements, assignments, operator-assignments -> paragraph 2 -> sentence 2 + * statements, assignments, operator-assignments -> paragraph 2 -> sentence 3 + * NUMBER: 2 + * DESCRIPTION: nullable receiver + */ + + + +fun box(): String { + val a: A? = A(B()) + val c: C = C() + a?.b += { c }() + if (f3 && !f1 && !f2 && !f4) { + f3 = false + a?.b.plusAssign({ c }()) + if (f3 && !f1 && !f2 && !f4) + return "OK" + } + return "NOK" +} + +class A(val b: B) + +var f1 = false +var f2 = false +var f3 = false +var f4 = false + +class B { + operator fun plusAssign(c: C) { + f1 = true + print("1") + } + + operator fun plus(c: C): C { + f2 = true + print("2") + return c + } +} + +operator fun B?.plusAssign(c: C) { + f3 = true + print("3") +} + +operator fun B?.plusAssign(c: Any) { + f4 = true + print("4") +} + + +class C \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.3.kt b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.3.kt new file mode 100644 index 00000000000..1894733afa9 --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.3.kt @@ -0,0 +1,61 @@ +// WITH_RUNTIME + +/* + * KOTLIN CODEGEN BOX SPEC TEST (POSITIVE) + * + * SPEC VERSION: 0.1-488 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2 + * PRIMARY LINKS: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 3 -> sentence 4 + * SECONDARY LINKS: statements, assignments, operator-assignments -> paragraph 2 -> sentence 1 + * statements, assignments, operator-assignments -> paragraph 2 -> sentence 2 + * statements, assignments, operator-assignments -> paragraph 2 -> sentence 3 + * NUMBER: 3 + * DESCRIPTION: nullable receiver + */ + +fun box(): String { + val a: A? = A(B()) + val c: C? = C() + + a!!.b += c?: C() + if (f1 && !f3 && !f2 && !f4) { + f3 = false + a!!.b.plusAssign(c?: C()) + if (f1 && !f3 && !f2 && !f4) + return "OK" + } + return "NOK" +} + +class A(val b: B) + +var f1 = false +var f2 = false +var f3 = false +var f4 = false + +class B { + operator fun plusAssign(c: C) { + f1 = true + print("1") + } + + operator fun plus(c: C?): C { + f2 = true + print("2") + return c!! + } +} + +operator fun B?.plusAssign(c: C?) { + f3 = true + print("3") +} + +operator fun B?.plusAssign(c: Any?) { + f4 = true + print("4") +} + + +class C \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.4.kt b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.4.kt new file mode 100644 index 00000000000..08acc37aa2e --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.4.kt @@ -0,0 +1,73 @@ +// WITH_RUNTIME + +/* + * KOTLIN CODEGEN BOX SPEC TEST (POSITIVE) + * + * SPEC VERSION: 0.1-488 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2 + * PRIMARY LINKS: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 3 -> sentence 3 + * SECONDARY LINKS: statements, assignments, operator-assignments -> paragraph 2 -> sentence 1 + * statements, assignments, operator-assignments -> paragraph 2 -> sentence 2 + * statements, assignments, operator-assignments -> paragraph 2 -> sentence 3 + * NUMBER: 4 + * DESCRIPTION: nullable receiver + */ + +fun box(): String { + val a: A? = A(B()) + val c: C? = C() + + a!!.b += c + if (f3 && !f1 && !f2 && !f4) { + f3 = false + a?.b.plusAssign(c) + if (f3 && !f1 && !f2 && !f4) + return "OK" + } + return "NOK" +} + +class A(val b: B) + +var f1 = false +var f2 = false +var f3 = false +var f4 = false +var f5 = false +var f6 = false + +class B { + operator fun plusAssign(c: C) { + f1 = true + print("1") + } + + operator fun plus(c: C?): C { + f2 = true + print("2") + return c!! + } +} + +operator fun B?.plusAssign(c: C?) { + f5 = true + print("5") +} + +operator fun B?.plusAssign(c: Any?) { + f6 = true + print("6") +} +@JvmName("aa") +operator fun B.plusAssign(c: C?) { + f3 = true + print("3") +} +@JvmName("bb") +operator fun B.plusAssign(c: Any?) { + f4 = true + print("4") +} + + +class C \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.5.kt b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.5.kt new file mode 100644 index 00000000000..08dbc8f9261 --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.5.kt @@ -0,0 +1,61 @@ +// WITH_RUNTIME + +/* + * KOTLIN CODEGEN BOX SPEC TEST (POSITIVE) + * + * SPEC VERSION: 0.1-488 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2 + * PRIMARY LINKS: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 3 -> sentence 3 + * SECONDARY LINKS: statements, assignments, operator-assignments -> paragraph 2 -> sentence 1 + * statements, assignments, operator-assignments -> paragraph 2 -> sentence 2 + * statements, assignments, operator-assignments -> paragraph 2 -> sentence 3 + * NUMBER: 5 + * DESCRIPTION: nullable receiver and infix functions + */ + +fun box(): String { + val a: A? = A(B()) + val c: C = C() + + a?.b += c + if (f3 && !f1 && !f2 && !f4) { + f3 = false + a?.b plusAssign c + if (f3 && !f1 && !f2 && !f4) + return "OK" + } + return "NOK" +} + +class A(val b: B) + +var f1 = false +var f2 = false +var f3 = false +var f4 = false + +class B { + infix operator fun plusAssign(c: C) { + f1 = true + print("1") + } + + infix operator fun plus(c: C): C { + f2 = true + print("2") + return c + } +} + +infix operator fun B?.plusAssign(c: C) { + f3 = true + print("3") +} + +infix operator fun B?.plusAssign(c: Any) { + f4 = true + print("4") +} + + +class C \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.6.kt b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.6.kt new file mode 100644 index 00000000000..2414e78edba --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.6.kt @@ -0,0 +1,62 @@ +// WITH_RUNTIME + +/* + * KOTLIN CODEGEN BOX SPEC TEST (POSITIVE) + * + * SPEC VERSION: 0.1-488 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2 + * PRIMARY LINKS: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 3 -> sentence 3 + * SECONDARY LINKS: statements, assignments, operator-assignments -> paragraph 2 -> sentence 1 + * statements, assignments, operator-assignments -> paragraph 2 -> sentence 2 + * statements, assignments, operator-assignments -> paragraph 2 -> sentence 3 + * NUMBER: 6 + * DESCRIPTION: nullable receiver and infix functions + */ + + + +fun box(): String { + val a: A? = A(B()) + val c: C = C() + a?.b += { c }() + if (f3 && !f1 && !f2 && !f4) { + f3 = false + a?.b plusAssign { c }() + if (f3 && !f1 && !f2 && !f4) + return "OK" + } + return "NOK" +} + +class A(val b: B) + +var f1 = false +var f2 = false +var f3 = false +var f4 = false + +class B { + infix operator fun plusAssign(c: C) { + f1 = true + print("1") + } + + infix operator fun plus(c: C): C { + f2 = true + print("2") + return c + } +} + +infix operator fun B?.plusAssign(c: C) { + f3 = true + print("3") +} + +infix operator fun B?.plusAssign(c: Any) { + f4 = true + print("4") +} + + +class C \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.7.kt b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.7.kt new file mode 100644 index 00000000000..0252af1355c --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.7.kt @@ -0,0 +1,61 @@ +// WITH_RUNTIME + +/* + * KOTLIN CODEGEN BOX SPEC TEST (POSITIVE) + * + * SPEC VERSION: 0.1-488 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2 + * PRIMARY LINKS: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 3 -> sentence 4 + * SECONDARY LINKS: statements, assignments, operator-assignments -> paragraph 2 -> sentence 1 + * statements, assignments, operator-assignments -> paragraph 2 -> sentence 2 + * statements, assignments, operator-assignments -> paragraph 2 -> sentence 3 + * NUMBER: 7 + * DESCRIPTION: nullable receiver and infix functions + */ + +fun box(): String { + val a: A? = A(B()) + val c: C? = C() + + a!!.b += c?: C() + if (f1 && !f3 && !f2 && !f4) { + f3 = false + a!!.b plusAssign (c?: C()) + if (f1 && !f3 && !f2 && !f4) + return "OK" + } + return "NOK" +} + +class A(val b: B) + +var f1 = false +var f2 = false +var f3 = false +var f4 = false + +class B { + infix operator fun plusAssign(c: C) { + f1 = true + print("1") + } + + infix operator fun plus(c: C?): C { + f2 = true + print("2") + return c!! + } +} + +infix operator fun B?.plusAssign(c: C?) { + f3 = true + print("3") +} + +infix operator fun B?.plusAssign(c: Any?) { + f4 = true + print("4") +} + + +class C \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.8.kt b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.8.kt new file mode 100644 index 00000000000..3666b9cd3a4 --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.8.kt @@ -0,0 +1,73 @@ +// WITH_RUNTIME + +/* + * KOTLIN CODEGEN BOX SPEC TEST (POSITIVE) + * + * SPEC VERSION: 0.1-488 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2 + * PRIMARY LINKS: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 3 -> sentence 3 + * SECONDARY LINKS: statements, assignments, operator-assignments -> paragraph 2 -> sentence 1 + * statements, assignments, operator-assignments -> paragraph 2 -> sentence 2 + * statements, assignments, operator-assignments -> paragraph 2 -> sentence 3 + * NUMBER: 8 + * DESCRIPTION: nullable receiver + */ + +fun box(): String { + val a: A? = A(B()) + val c: C? = C() + + a!!.b += c + if (f3 && !f1 && !f2 && !f4) { + f3 = false + a?.b plusAssign c + if (f3 && !f1 && !f2 && !f4) + return "OK" + } + return "NOK" +} + +class A(val b: B) + +var f1 = false +var f2 = false +var f3 = false +var f4 = false +var f5 = false +var f6 = false + +class B { + infix operator fun plusAssign(c: C) { + f1 = true + print("1") + } + + infix operator fun plus(c: C?): C { + f2 = true + print("2") + return c!! + } +} + +infix operator fun B?.plusAssign(c: C?) { + f5 = true + print("5") +} + +infix operator fun B?.plusAssign(c: Any?) { + f6 = true + print("6") +} +@JvmName("aa") +infix operator fun B.plusAssign(c: C?) { + f3 = true + print("3") +} +@JvmName("bb") +infix operator fun B.plusAssign(c: Any?) { + f4 = true + print("4") +} + + +class C \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.9.kt b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.9.kt new file mode 100644 index 00000000000..21136417bbd --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.9.kt @@ -0,0 +1,64 @@ +// WITH_RUNTIME + +/* + * KOTLIN CODEGEN BOX SPEC TEST (POSITIVE) + * + * SPEC VERSION: 0.1-488 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2 + * PRIMARY LINKS: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 3 -> sentence 3 + * SECONDARY LINKS: statements, assignments, operator-assignments -> paragraph 2 -> sentence 1 + * statements, assignments, operator-assignments -> paragraph 2 -> sentence 2 + * statements, assignments, operator-assignments -> paragraph 2 -> sentence 3 + * NUMBER: 9 + * DESCRIPTION: nullable receiver and inline operator function + */ + +fun cc() : C = C() + +fun box(): String { + val a: A? = A(B()) + + a?.b += ::cc + if (f3 && !f1 && !f2 && !f4) { + f3 = false + a?.b.plusAssign(::cc) + if (f3 && !f1 && !f2 && !f4) + return "OK" + } + return "NOK" +} + +class A(val b: B) + +var f1 = false +var f2 = false +var f3 = false +var f4 = false + + +class B { + inline operator fun plusAssign(c: ()->C) { + f1 = true + print("1") + } + + inline operator fun plus(c: ()->C): C { + f2 = true + print("2") + return c() + } +} + +@JvmName("aa") +inline operator fun B?.plusAssign(c: ()->C) { + f3 = true + print("3") +} +@JvmName("bb") +inline operator fun B?.plusAssign(c: ()->Any) { + f4 = true + print("4") +} + + +class C \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/testsMap.json b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/testsMap.json index 90ae7fee389..0aa7961a05e 100644 --- a/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/testsMap.json +++ b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/testsMap.json @@ -1,4 +1,142 @@ { + "1": { + "neg": { + "2": [ + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.1.kt", + "unexpectedBehaviour": false, + "linkType": "main" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and infix functions", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.5.kt", + "unexpectedBehaviour": false, + "linkType": "main" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and infix functions", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.4.kt", + "unexpectedBehaviour": false, + "linkType": "main" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.3.kt", + "unexpectedBehaviour": false, + "linkType": "main" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.2.kt", + "unexpectedBehaviour": false, + "linkType": "main" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and infix functions", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.6.kt", + "unexpectedBehaviour": false, + "linkType": "main" + } + ] + }, + "pos": { + "2": [ + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and inline operator function", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.10.kt", + "unexpectedBehaviour": false, + "linkType": "main" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.1.kt", + "unexpectedBehaviour": false, + "linkType": "main" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and infix functions", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.5.kt", + "unexpectedBehaviour": false, + "linkType": "main" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.4.kt", + "unexpectedBehaviour": false, + "linkType": "main" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and inline operator function", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.9.kt", + "unexpectedBehaviour": false, + "linkType": "main" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.8.kt", + "unexpectedBehaviour": false, + "linkType": "main" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and infix functions", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.7.kt", + "unexpectedBehaviour": false, + "linkType": "main" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.3.kt", + "unexpectedBehaviour": false, + "linkType": "main" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.2.kt", + "unexpectedBehaviour": false, + "linkType": "main" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and infix functions", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.6.kt", + "unexpectedBehaviour": false, + "linkType": "main" + } + ] + } + }, "2": { "pos": { "3": [ diff --git a/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/testsMap.json b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/testsMap.json index 84ddaaec16f..ed75feae146 100644 --- a/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/testsMap.json +++ b/compiler/tests-spec/testData/codegen/box/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/testsMap.json @@ -18,6 +18,90 @@ "unexpectedBehaviour": false, "linkType": "main" } + ], + "3": [ + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and inline operator function", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.10.kt", + "unexpectedBehaviour": false, + "linkType": "primary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.1.kt", + "unexpectedBehaviour": false, + "linkType": "primary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and infix functions", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.5.kt", + "unexpectedBehaviour": false, + "linkType": "primary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.4.kt", + "unexpectedBehaviour": false, + "linkType": "primary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and inline operator function", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.9.kt", + "unexpectedBehaviour": false, + "linkType": "primary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.8.kt", + "unexpectedBehaviour": false, + "linkType": "primary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.2.kt", + "unexpectedBehaviour": false, + "linkType": "primary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and infix functions", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.6.kt", + "unexpectedBehaviour": false, + "linkType": "primary" + } + ], + "4": [ + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and infix functions", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.7.kt", + "unexpectedBehaviour": false, + "linkType": "primary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.3.kt", + "unexpectedBehaviour": false, + "linkType": "primary" + } ] } } diff --git a/compiler/tests-spec/testData/codegen/box/linked/statements/assignments/operator-assignments/testsMap.json b/compiler/tests-spec/testData/codegen/box/linked/statements/assignments/operator-assignments/testsMap.json index 1cd9e00d0fc..af6b66b7cea 100644 --- a/compiler/tests-spec/testData/codegen/box/linked/statements/assignments/operator-assignments/testsMap.json +++ b/compiler/tests-spec/testData/codegen/box/linked/statements/assignments/operator-assignments/testsMap.json @@ -17,6 +17,54 @@ "path": "compiler/tests-spec/testData/codegen/box/linked/statements/assignments/operator-assignments/p-2/neg/1.1.kt", "unexpectedBehaviour": false, "linkType": "main" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.1.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and infix functions", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.5.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and infix functions", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.4.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.3.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.2.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and infix functions", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.6.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" } ], "2": [ @@ -35,6 +83,54 @@ "path": "compiler/tests-spec/testData/codegen/box/linked/statements/assignments/operator-assignments/p-2/neg/1.1.kt", "unexpectedBehaviour": false, "linkType": "primary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.1.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and infix functions", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.5.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and infix functions", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.4.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.3.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.2.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and infix functions", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.6.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" } ], "3": [ @@ -45,6 +141,54 @@ "path": "compiler/tests-spec/testData/codegen/box/linked/statements/assignments/operator-assignments/p-2/neg/1.2.kt", "unexpectedBehaviour": false, "linkType": "primary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.1.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and infix functions", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.5.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and infix functions", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.4.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.3.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.2.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and infix functions", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.6.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" } ], "10": [ @@ -249,6 +393,86 @@ "path": "compiler/tests-spec/testData/codegen/box/linked/statements/assignments/operator-assignments/p-2/pos/1.1.kt", "unexpectedBehaviour": false, "linkType": "main" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and inline operator function", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.10.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.1.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and infix functions", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.5.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.4.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and inline operator function", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.9.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.8.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and infix functions", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.7.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.3.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.2.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and infix functions", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.6.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" } ], "2": [ @@ -267,6 +491,86 @@ "path": "compiler/tests-spec/testData/codegen/box/linked/statements/assignments/operator-assignments/p-2/pos/1.1.kt", "unexpectedBehaviour": false, "linkType": "primary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and inline operator function", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.10.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.1.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and infix functions", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.5.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.4.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and inline operator function", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.9.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.8.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and infix functions", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.7.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.3.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.2.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and infix functions", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.6.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" } ], "3": [ @@ -277,6 +581,86 @@ "path": "compiler/tests-spec/testData/codegen/box/linked/statements/assignments/operator-assignments/p-2/pos/1.2.kt", "unexpectedBehaviour": false, "linkType": "primary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and inline operator function", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.10.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.1.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and infix functions", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.5.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.4.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and inline operator function", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.9.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.8.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and infix functions", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.7.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.3.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.2.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-488", + "casesNumber": 0, + "description": "nullable receiver and infix functions", + "path": "compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.6.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" } ], "10": [ diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.1.fir.kt new file mode 100644 index 00000000000..99278a844c7 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.1.fir.kt @@ -0,0 +1,47 @@ +// !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 testPackCase1 + +class C +@JvmName("bb1") +fun C?.boo( c: ()->Any) {} //(1) + +@JvmName("aa1") +fun C?.boo( c: ()->C) : String { //(2) + val x = {1} + this.boo( x )// ok to (1) + this.boo( x ) + + this.boo( {1}) //to (2); {1} is ()->C + this.boo( {1}) + + return "" +} +// FILE: TestCase2.kt +/* + * TESTCASE NUMBER: 2 + */ +package testPackCase2 + +class C +@JvmName("bb1") +fun C?.boo( c: ()->Any) {} //(1) + +@JvmName("aa1") +fun C?.boo( c: ()->C, x : Int = 1) : String { //(2) + val x = {1} + this.boo( x )// ok to (1) + this.boo( x ) + + this.boo( {1}) //to (2); {1} is ()->C + this.boo( {1}) + + return "" +} diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.1.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.1.kt new file mode 100644 index 00000000000..02aea31e5aa --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.1.kt @@ -0,0 +1,56 @@ +// !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-448 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2 + * PRIMARY LINKS: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 3 -> sentence 1 + * NUMBER: 1 + * DESCRIPTION: call with lambda as argument + */ + +// FILE: TestCase1.kt +/* + * TESTCASE NUMBER: 1 + */ +package testPackCase1 + +class C +@JvmName("bb1") +fun C?.boo( c: ()->Any) {} //(1) + +@JvmName("aa1") +fun C?.boo( c: ()->C) : String { //(2) + val x = {1} + this.boo( x )// ok to (1) + this.boo( x ) + + this.boo( {1}) //to (2); {1} is ()->C + this.boo( {1}) + + return "" +} +// FILE: TestCase2.kt +/* + * TESTCASE NUMBER: 2 + */ +package testPackCase2 + +class C +@JvmName("bb1") +fun C?.boo( c: ()->Any) {} //(1) + +@JvmName("aa1") +fun C?.boo( c: ()->C, x : Int = 1) : String { //(2) + val x = {1} + this.boo( x )// ok to (1) + this.boo( x ) + + this.boo( {1}) //to (2); {1} is ()->C + this.boo( {1}) + + return "" +} \ No newline at end of file diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.2.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.2.fir.kt new file mode 100644 index 00000000000..ef013bdae6c --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.2.fir.kt @@ -0,0 +1,27 @@ +// !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 testPackCase1 + +class B { + inline operator fun plusAssign(crossinline c: ()->C) {} + + inline operator fun plus(crossinline c: ()->C): C = C() +} + +@JvmName("bb") +inline operator fun B?.plusAssign( c: ()->Any) { } //(1) +@JvmName("aa") +inline operator fun B?.plusAssign( c: ()->C) { //(2) + + this += {1} + this += {1} +} + +class C diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.2.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.2.kt new file mode 100644 index 00000000000..7cae8552290 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.2.kt @@ -0,0 +1,36 @@ +// !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-448 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2 + * PRIMARY LINKS: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 3 -> sentence 1 + * NUMBER: 2 + * DESCRIPTION: plusAssign as inline function + */ + +// FILE: TestCase1.kt +/* + * TESTCASE NUMBER: 1 + */ +package testPackCase1 + +class B { + inline operator fun plusAssign(crossinline c: ()->C) {} + + inline operator fun plus(crossinline c: ()->C): C = C() +} + +@JvmName("bb") +inline operator fun B?.plusAssign( c: ()->Any) { } //(1) +@JvmName("aa") +inline operator fun B?.plusAssign( c: ()->C) { //(2) + + this += {1} + this += {1} +} + +class C \ No newline at end of file diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.4.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.4.fir.kt new file mode 100644 index 00000000000..d758a058994 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.4.fir.kt @@ -0,0 +1,42 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION +// SKIP_TXT + + + +// FILE: TestCase1.kt +/* + * TESTCASE NUMBER: 1 + * NOTE: + */ +package testPackCase1 +import LibPackCase1.a.* +import LibPackCase1.b.* + +fun case1 (){ + var b: B? = B() + b += { C() } + + b += {1} +} + +class B { + private operator fun plusAssign(c: () -> C) {} + private operator fun plus(c: () -> C): C = c() +} +class C + +// FILE: LibCase1.kt +package LibPackCase1.b +import LibPackCase1.a.* +import testPackCase1.B +import testPackCase1.C + +operator fun B?.plusAssign( c: ()->C) {} //(2) + + +// FILE: LibCase1.kt +package LibPackCase1.a +import testPackCase1.B + +operator fun B?.plusAssign( c: ()->Int) {} //(1) diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.4.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.4.kt new file mode 100644 index 00000000000..c27545fd57a --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.4.kt @@ -0,0 +1,90 @@ +// !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-448 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2 + * PRIMARY LINKS: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 3 -> sentence 1 + * NUMBER: 4 + * DESCRIPTION: without inline plusAssign functions + * UNEXPECTED BEHAVIOUR + * ISSUES: KT-39819 + */ + + +// FILE: TestCase1.kt +/* + * TESTCASE NUMBER: 1 + * NOTE: + */ +package testPackCase1 +import LibPackCase1.a.* +import LibPackCase1.b.* + +fun case1 (){ + var b: B? = B() + b += { C() } + + b += {1} +} + +class B { + private operator fun plusAssign(c: () -> C) {} + private operator fun plus(c: () -> C): C = c() //(3) +} +class C + +// FILE: LibCase1b.kt +package LibPackCase1.b +import LibPackCase1.a.* +import testPackCase1.B +import testPackCase1.C + +operator fun B?.plusAssign( c: ()->C) {} //(2) + + +// FILE: LibCase1a.kt +package LibPackCase1.a +import testPackCase1.B + +operator fun B?.plusAssign( c: ()->Int) {} //(1) + +// FILE: TestCase2.kt +/* + * TESTCASE NUMBER: 2 + * NOTE: + */ +package testPackCase2 +import LibPackCase2.a.* +import LibPackCase2.b.* + +fun case2 (){ + var b: B = B() + b += { C() } + + b += {1} +} + +class B { + private operator fun plusAssign(c: () -> C) {} + private operator fun plus(c: () -> C): C = c() //(3) +} +class C + +// FILE: LibCase2b.kt +package LibPackCase2.b +import LibPackCase2.a.* +import testPackCase2.B +import testPackCase2.C + +operator fun B.plusAssign( c: ()->C) {} //(2) + + +// FILE: LibCase2a.kt +package LibPackCase2.a +import testPackCase2.B + +operator fun B.plusAssign( c: ()->Int) {} //(1) \ No newline at end of file diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.5.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.5.fir.kt new file mode 100644 index 00000000000..375ff17f305 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.5.fir.kt @@ -0,0 +1,39 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION +// SKIP_TXT + + +// TESTCASE NUMBER: 1 +// FILE: TestCase1.kt +package testPackCase1 +import LibPackCase1.a.* +import LibPackCase1.b.* +fun case1 (){ + var b: B? = null + b += { C() } + + b += {1} +} + +class B { + private inline operator fun plusAssign(c: () -> C) {} + + private inline operator fun plus(c: () -> C): C = c() +} + + +// FILE: LibCase1a.kt +package LibPackCase1.a +import testPackCase1.B + +inline operator fun B?.plusAssign( c: ()->Int) {} //(1) + + +// FILE: LibCase1b.kt +package LibPackCase1.b +import LibPackCase1.a.* +import testPackCase1.B + +inline operator fun B?.plusAssign( c: ()->C) {} //(2) + +class C diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.5.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.5.kt new file mode 100644 index 00000000000..614aeaef315 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.5.kt @@ -0,0 +1,50 @@ +// !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-448 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2 + * PRIMARY LINKS: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 3 -> sentence 1 + * NUMBER: 5 + * DESCRIPTION: inline plusAssign functions + * UNEXPECTED BEHAVIOUR + * ISSUES: KT-39819 + */ + +// TESTCASE NUMBER: 1 +// FILE: TestCase1.kt +package testPackCase1 +import LibPackCase1.a.* +import LibPackCase1.b.* +fun case1 (){ + var b: B? = null + b += { C() } + + b += {1} +} + +class B { + private inline operator fun plusAssign(c: () -> C) {} + + private inline operator fun plus(c: () -> C): C = c() +} + + +// FILE: LibCase1a.kt +package LibPackCase1.a +import testPackCase1.B + +inline operator fun B?.plusAssign( c: ()->Int) {} //(1) + + +// FILE: LibCase1b.kt +package LibPackCase1.b +import LibPackCase1.a.* +import testPackCase1.B + +inline operator fun B?.plusAssign( c: ()->C) {} //(2) + +class C \ No newline at end of file diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.6.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.6.fir.kt new file mode 100644 index 00000000000..c76c7352085 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.6.fir.kt @@ -0,0 +1,42 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION +// SKIP_TXT + + + +// FILE: TestCase1.kt +/* + * TESTCASE NUMBER: 1 + * NOTE: + */ +package testPackCase1 +import LibPackCase1.a.* +import LibPackCase1.b.* + +fun case1 (){ + var b: B? = B() + b += { C() } + + b += {1} +} + +class B { + private operator fun plusAssign(c: () -> C) {} +// private operator fun plus(c: () -> C): C = c() +} +class C + +// FILE: LibCase1b.kt +package LibPackCase1.b +import LibPackCase1.a.* +import testPackCase1.B +import testPackCase1.C + +operator fun B?.plusAssign( c: ()->C) {} //(2) + + +// FILE: LibCase1a.kt +package LibPackCase1.a +import testPackCase1.B + +operator fun B?.plusAssign( c: ()->Int) {} //(1) diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.6.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.6.kt new file mode 100644 index 00000000000..1e79e1c7c5f --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.6.kt @@ -0,0 +1,53 @@ +// !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-448 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2 + * PRIMARY LINKS: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 3 -> sentence 1 + * NUMBER: 6 + * DESCRIPTION: without inline plusAssign functions + * UNEXPECTED BEHAVIOUR + * ISSUES: KT-39820 + */ + + +// FILE: TestCase1.kt +/* + * TESTCASE NUMBER: 1 + * NOTE: + */ +package testPackCase1 +import LibPackCase1.a.* +import LibPackCase1.b.* + +fun case1 (){ + var b: B? = B() + b += { C() } + + b += {1} +} + +class B { + private operator fun plusAssign(c: () -> C) {} +// private operator fun plus(c: () -> C): C = c() +} +class C + +// FILE: LibCase1b.kt +package LibPackCase1.b +import LibPackCase1.a.* +import testPackCase1.B +import testPackCase1.C + +operator fun B?.plusAssign( c: ()->C) {} //(2) + + +// FILE: LibCase1a.kt +package LibPackCase1.a +import testPackCase1.B + +operator fun B?.plusAssign( c: ()->Int) {} //(1) \ No newline at end of file diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.7.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.7.fir.kt new file mode 100644 index 00000000000..c884bb5a4e2 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.7.fir.kt @@ -0,0 +1,42 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION +// SKIP_TXT + + + +// FILE: TestCase1.kt +/* + * TESTCASE NUMBER: 1 + * NOTE: + */ +package testPackCase1 +import LibPackCase1.a.plusAssign +import LibPackCase1.b.plusAssign + +fun case1 (){ + var b: B? = B() + b += { C() } + + b += {1} +} + +class B { + private operator fun plusAssign(c: () -> C) {} +// private operator fun plus(c: () -> C): C = c() +} +class C + +// FILE: LibCase1b.kt +package LibPackCase1.b +import LibPackCase1.a.* +import testPackCase1.B +import testPackCase1.C + +operator fun B?.plusAssign( c: ()->C) {} //(2) + + +// FILE: LibCase1a.kt +package LibPackCase1.a +import testPackCase1.B + +operator fun B?.plusAssign( c: ()->Int) {} //(1) diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.7.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.7.kt new file mode 100644 index 00000000000..dd100d8b2ef --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.7.kt @@ -0,0 +1,53 @@ +// !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-448 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2 + * PRIMARY LINKS: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 3 -> sentence 1 + * NUMBER: 7 + * DESCRIPTION: without inline plusAssign functions + * UNEXPECTED BEHAVIOUR + * ISSUES: KT-39820 + */ + + +// FILE: TestCase1.kt +/* + * TESTCASE NUMBER: 1 + * NOTE: + */ +package testPackCase1 +import LibPackCase1.a.plusAssign +import LibPackCase1.b.plusAssign + +fun case1 (){ + var b: B? = B() + b += { C() } + + b += {1} +} + +class B { + private operator fun plusAssign(c: () -> C) {} +// private operator fun plus(c: () -> C): C = c() +} +class C + +// FILE: LibCase1b.kt +package LibPackCase1.b +import LibPackCase1.a.* +import testPackCase1.B +import testPackCase1.C + +operator fun B?.plusAssign( c: ()->C) {} //(2) + + +// FILE: LibCase1a.kt +package LibPackCase1.a +import testPackCase1.B + +operator fun B?.plusAssign( c: ()->Int) {} //(1) \ No newline at end of file diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.8.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.8.fir.kt new file mode 100644 index 00000000000..7c940a12ed0 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.8.fir.kt @@ -0,0 +1,73 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION +// SKIP_TXT + + + +// FILE: TestCase1.kt +/* + * TESTCASE NUMBER: 1 + * NOTE: + */ +package testPackCase1 +import LibPackCase1.a.plusAssign +import LibPackCase1.b.plusAssign + +fun case1 (){ + var b: B = B() + b +={ C() } + b +={ 1 } +} + +class B +class C + +// FILE: LibCase1b.kt +package LibPackCase1.b +import LibPackCase1.a.* +import testPackCase1.B +import testPackCase1.C + +operator fun B?.plusAssign( c: ()->C) {} //(2) + + +// FILE: LibCase1a.kt +package LibPackCase1.a +import testPackCase1.B + +operator fun B?.plusAssign( c: ()->Int) {} //(1) + +// FILE: TestCase2.kt +/* + * TESTCASE NUMBER: 1 + * NOTE: + */ +package testPackCase2 +import LibPackCase2.a.plusAssign +import LibPackCase2.b.plusAssign + +fun case2 (){ + var b: B = B() + b +={ C() } + b +={ 1 } + + b.plusAssign{ C() } +} + +class B +class C + +// FILE: LibCase2b.kt +package LibPackCase2.b +import LibPackCase2.a.* +import testPackCase2.B +import testPackCase2.C + +operator fun B.plusAssign( c: ()->C) {} //(2) + + +// FILE: LibCase2a.kt +package LibPackCase2.a +import testPackCase2.B + +operator fun B.plusAssign( c: ()->Int) {} //(1) diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.8.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.8.kt new file mode 100644 index 00000000000..1bc4a7ddf69 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.8.kt @@ -0,0 +1,84 @@ +// !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-448 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2 + * PRIMARY LINKS: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 3 -> sentence 1 + * NUMBER: 8 + * DESCRIPTION: without inline plusAssign functions + * UNEXPECTED BEHAVIOUR + * ISSUES: KT-39820 + */ + + +// FILE: TestCase1.kt +/* + * TESTCASE NUMBER: 1 + * NOTE: + */ +package testPackCase1 +import LibPackCase1.a.plusAssign +import LibPackCase1.b.plusAssign + +fun case1 (){ + var b: B = B() + b +={ C() } + b +={ 1 } +} + +class B +class C + +// FILE: LibCase1b.kt +package LibPackCase1.b +import LibPackCase1.a.* +import testPackCase1.B +import testPackCase1.C + +operator fun B?.plusAssign( c: ()->C) {} //(2) + + +// FILE: LibCase1a.kt +package LibPackCase1.a +import testPackCase1.B + +operator fun B?.plusAssign( c: ()->Int) {} //(1) + +// FILE: TestCase2.kt +/* + * TESTCASE NUMBER: 1 + * NOTE: + */ +package testPackCase2 +import LibPackCase2.a.plusAssign +import LibPackCase2.b.plusAssign + +fun case2 (){ + var b: B = B() + b +={ C() } + b +={ 1 } + + b.plusAssign{ C() } +} + +class B +class C + +// FILE: LibCase2b.kt +package LibPackCase2.b +import LibPackCase2.a.* +import testPackCase2.B +import testPackCase2.C + +operator fun B.plusAssign( c: ()->C) {} //(2) + + +// FILE: LibCase2a.kt +package LibPackCase2.a +import testPackCase2.B + +operator fun B.plusAssign( c: ()->Int) {} //(1) \ No newline at end of file diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.9.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.9.fir.kt new file mode 100644 index 00000000000..5dec7278f67 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.9.fir.kt @@ -0,0 +1,37 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION +// SKIP_TXT + + + +// FILE: TestCase1.kt +/* + * TESTCASE NUMBER: 1 + * NOTE: + */ +package testPackCase1 +import LibPackCase1.a.plusAssign + +fun case1 (){ + var b: B = B() + b +={ C() } + b +={ 1 } +} + +class B +class C + +// FILE: LibCase1b.kt +package LibPackCase1.b +import LibPackCase1.a.* +import testPackCase1.B +import testPackCase1.C + +operator fun B?.plusAssign( c: ()->C) {} //(2) + + +// FILE: LibCase1a.kt +package LibPackCase1.a +import testPackCase1.B + +operator fun B?.plusAssign( c: ()->Int) {} //(1) diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.9.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.9.kt new file mode 100644 index 00000000000..24c9d49aa2f --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.9.kt @@ -0,0 +1,47 @@ +// !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-448 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2 + * PRIMARY LINKS: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 3 -> sentence 1 + * overload-resolution, determining-function-applicability-for-a-specific-call, description -> paragraph 2 -> sentence 2 + * NUMBER: 9 + * DESCRIPTION: without inline plusAssign functions + */ + + +// FILE: TestCase1.kt +/* + * TESTCASE NUMBER: 1 + * NOTE: + */ +package testPackCase1 +import LibPackCase1.a.plusAssign + +fun case1 (){ + var b: B = B() + b +={ C() } + b +={ 1 } +} + +class B +class C + +// FILE: LibCase1b.kt +package LibPackCase1.b +import LibPackCase1.a.* +import testPackCase1.B +import testPackCase1.C + +operator fun B?.plusAssign( c: ()->C) {} //(2) + + +// FILE: LibCase1a.kt +package LibPackCase1.a +import testPackCase1.B + +operator fun B?.plusAssign( c: ()->Int) {} //(1) \ No newline at end of file diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.1.fir.kt new file mode 100644 index 00000000000..55a95cd8b2b --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.1.fir.kt @@ -0,0 +1,120 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION +// SKIP_TXT + + +// FILE: TestCase1.kt +// TESTCASE NUMBER: 1 +package testPackCase1 + +fun case1(a: A, c: C) { + + a?.b += c + a?.b .plusAssign(c) + + val x = { + a?.b += c + a?.b.plusAssign(c) + }() + + a?.b += { c }() + + a?.b.plusAssign({ c }()) +} + +class A(val b: B) + +class B { + operator fun plusAssign(c: C) { + print("1") + } + + operator fun plus(c: C): C { + print("2") + return c + } +} + +class C + +// FILE: TestCase2.kt +// TESTCASE NUMBER: 2 +package testPackCase2 + +fun case2(a: A?, c: C) { + + a?.b += c + a?.b.plusAssign(c) + + val x = { + a?.b += c + a?.b.plusAssign(c) + }() + + a?.b += { c }() + + a?.b.plusAssign({ c }()) + +} + +class A(val b: B) + +class B { + operator fun plusAssign(c: C) { + print("1") + } + + operator fun plus(c: C): C { + print("2") + return c + } +} + +operator fun B?.plusAssign(c: C) { + print("3") +} + +class C +// FILE: TestCase3.kt +// TESTCASE NUMBER: 3 +package testPackCase3 + +fun case3(a: A?, c: C) { + + a?.b += c + a?.b.plusAssign(c) + + val x = { + a?.b += c + a?.b.plusAssign(c) + }() + + a?.b += { c }() + + a?.b.plusAssign({ c }()) + +} + +class A(val b: B) + +class B { + operator fun plusAssign(c: C) { + print("1") + } + + operator fun plus(c: C): C { + print("2") + return c + } +} + +operator fun B?.plusAssign(c: C) { + print("3") +} + +operator fun B?.plusAssign(c: Any) { + print("4") +} + + +class C diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.1.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.1.kt new file mode 100644 index 00000000000..b31a0d68b0e --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.1.kt @@ -0,0 +1,131 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION +// SKIP_TXT + +/* + * KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE) + * + * SPEC VERSION: 0.1-448 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2 + * SECONDARY LINKS: statements, assignments, operator-assignments -> paragraph 2 -> sentence 1 + * statements, assignments, operator-assignments -> paragraph 2 -> sentence 2 + * statements, assignments, operator-assignments -> paragraph 2 -> sentence 3 + * NUMBER: 1 + * DESCRIPTION: Non-extension member callables + */ + +// FILE: TestCase1.kt +// TESTCASE NUMBER: 1 +package testPackCase1 + +fun case1(a: A, c: C) { + + a?.b += c + a?.b .plusAssign(c) + + val x = { + a?.b += c + a?.b.plusAssign(c) + }() + + a?.b += { c }() + + a?.b.plusAssign({ c }()) +} + +class A(val b: B) + +class B { + operator fun plusAssign(c: C) { + print("1") + } + + operator fun plus(c: C): C { + print("2") + return c + } +} + +class C + +// FILE: TestCase2.kt +// TESTCASE NUMBER: 2 +package testPackCase2 + +fun case2(a: A?, c: C) { + + a?.b += c + a?.b.plusAssign(c) + + val x = { + a?.b += c + a?.b.plusAssign(c) + }() + + a?.b += { c }() + + a?.b.plusAssign({ c }()) + +} + +class A(val b: B) + +class B { + operator fun plusAssign(c: C) { + print("1") + } + + operator fun plus(c: C): C { + print("2") + return c + } +} + +operator fun B?.plusAssign(c: C) { + print("3") +} + +class C +// FILE: TestCase3.kt +// TESTCASE NUMBER: 3 +package testPackCase3 + +fun case3(a: A?, c: C) { + + a?.b += c + a?.b.plusAssign(c) + + val x = { + a?.b += c + a?.b.plusAssign(c) + }() + + a?.b += { c }() + + a?.b.plusAssign({ c }()) + +} + +class A(val b: B) + +class B { + operator fun plusAssign(c: C) { + print("1") + } + + operator fun plus(c: C): C { + print("2") + return c + } +} + +operator fun B?.plusAssign(c: C) { + print("3") +} + +operator fun B?.plusAssign(c: Any) { + print("4") +} + + +class C \ No newline at end of file diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.2.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.2.fir.kt new file mode 100644 index 00000000000..1883850ef07 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.2.fir.kt @@ -0,0 +1,36 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION +// SKIP_TXT + + +// FILE: LibCase1b.kt +// TESTCASE NUMBER: 1 +package LibPackCase1.b + +import testPackCase1.B +import LibPackCase1.a.* + +inline operator fun B?.plusAssign( c: ()->C) { //(2) + val x = {1} + this += x //to (1) + this += x +} + +class C + +// FILE: TestCase1.kt +package testPackCase1 + +import LibPackCase1.a.* +import LibPackCase1.b.* + +class B { + private inline operator fun plusAssign(crossinline c: ()->C) {} + private inline operator fun plus(crossinline c: ()->C): C =C() +} + +// FILE: LibCase1a.kt +package LibPackCase1.a +import testPackCase1.B + +inline operator fun B?.plusAssign( c: ()->Int) { } //(1) diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.2.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.2.kt new file mode 100644 index 00000000000..362adcd569b --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.2.kt @@ -0,0 +1,47 @@ + +// !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-448 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2 + * PRIMARY LINKS: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 3 -> sentence 1 + * NUMBER: 2 + * DESCRIPTION: plusAssign as inline function + */ + +// FILE: LibCase1b.kt +// TESTCASE NUMBER: 1 +package LibPackCase1.b + +import testPackCase1.B +import LibPackCase1.a.* + +inline operator fun B?.plusAssign( c: ()->C) { //(2) + val x = {1} + this += x //to (1) + this += x +} + +class C + +// FILE: TestCase1.kt +package testPackCase1 + +import LibPackCase1.a.* +import LibPackCase1.b.* + +class B { + private inline operator fun plusAssign(crossinline c: ()->C) {} + private inline operator fun plus(crossinline c: ()->C): C =C() +} + +// FILE: LibCase1a.kt +package LibPackCase1.a +import testPackCase1.B + +inline operator fun B?.plusAssign( c: ()->Int) { } //(1) + diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.1.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.1.kt index 85e64aa9179..09355fd4f0e 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.1.kt @@ -17,6 +17,7 @@ // FILE: LibCase1.kt // TESTCASE NUMBER: 1, 2 +// TESTCASE NUMBER: 1, 2 package libPackage import testPackCase1.Case diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/testsMap.json b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/testsMap.json index 6c2bdbaac3b..2019c678c81 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/testsMap.json +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/testsMap.json @@ -146,5 +146,95 @@ } ] } + }, + "1": { + "neg": { + "2": [ + { + "specVersion": "0.1-448", + "casesNumber": 2, + "description": "call with lambda as argument", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.1.kt", + "unexpectedBehaviour": false, + "linkType": "main" + }, + { + "specVersion": "0.1-448", + "casesNumber": 1, + "description": "inline plusAssign functions", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.5.kt", + "unexpectedBehaviour": true, + "linkType": "main" + }, + { + "specVersion": "0.1-448", + "casesNumber": 2, + "description": "without inline plusAssign functions", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.4.kt", + "unexpectedBehaviour": true, + "linkType": "main" + }, + { + "specVersion": "0.1-448", + "casesNumber": 1, + "description": "without inline plusAssign functions", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.9.kt", + "unexpectedBehaviour": false, + "linkType": "main" + }, + { + "specVersion": "0.1-448", + "casesNumber": 1, + "description": "without inline plusAssign functions", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.8.kt", + "unexpectedBehaviour": true, + "linkType": "main" + }, + { + "specVersion": "0.1-448", + "casesNumber": 1, + "description": "without inline plusAssign functions", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.7.kt", + "unexpectedBehaviour": true, + "linkType": "main" + }, + { + "specVersion": "0.1-448", + "casesNumber": 1, + "description": "plusAssign as inline function", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.2.kt", + "unexpectedBehaviour": false, + "linkType": "main" + }, + { + "specVersion": "0.1-448", + "casesNumber": 1, + "description": "without inline plusAssign functions", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.6.kt", + "unexpectedBehaviour": true, + "linkType": "main" + } + ] + }, + "pos": { + "2": [ + { + "specVersion": "0.1-448", + "casesNumber": 3, + "description": "Non-extension member callables", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.1.kt", + "unexpectedBehaviour": false, + "linkType": "main" + }, + { + "specVersion": "0.1-448", + "casesNumber": 1, + "description": "plusAssign as inline function", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.2.kt", + "unexpectedBehaviour": false, + "linkType": "main" + } + ] + } } } \ No newline at end of file diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.2.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.2.fir.kt new file mode 100644 index 00000000000..bb0cc4e3802 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.2.fir.kt @@ -0,0 +1,75 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION +// SKIP_TXT + + +// FILE: TestCase1.kt +/* + * TESTCASE NUMBER: 1 + * NOTE: + */ +package testPackCase1 + +import LibPackCase1.a.boo +import LibPackCase1.b.boo + +fun case1 (b: B?){ + b.boo({ C() }) + b.boo({1}) +} + +class B { +// private fun boo(c: () -> C) {} +} +class C + +// FILE: LibCase1.kt +package LibPackCase1.b +import LibPackCase1.a.* +import testPackCase1.B +import testPackCase1.C + +fun B?.boo( c: ()->C) {} //(2) + + +// FILE: LibCase1.kt +package LibPackCase1.a +import testPackCase1.B + +fun B?.boo( c: ()->Int) { //(1) +} + +// FILE: TestCase2.kt +/* + * TESTCASE NUMBER: 2 + */ +package testPackCase2 + +import LibPackCase2.a.* +import LibPackCase2.b.* + +fun case2 (b: B?){ + b.boo({ C() }) + b.boo({1}) +} + +class B { +// private fun boo(c: () -> C) {} +} +class C + +// FILE: LibCase2.kt +package LibPackCase2.b +import LibPackCase2.a.* +import testPackCase2.B +import testPackCase2.C + +fun B?.boo( c: ()->C) {} //(2) + + +// FILE: LibCase2.kt +package LibPackCase2.a +import testPackCase2.B + +fun B?.boo( c: ()->Int) { //(1) +} diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.2.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.2.kt new file mode 100644 index 00000000000..89fa233de6d --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.2.kt @@ -0,0 +1,83 @@ +// !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-448 + * MAIN LINK: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 9 -> sentence 2 + * NUMBER: 2 + * DESCRIPTION: explicit receiver ambuguity + */ + +// FILE: TestCase1.kt +/* + * TESTCASE NUMBER: 1 + * NOTE: + */ +package testPackCase1 + +import LibPackCase1.a.boo +import LibPackCase1.b.boo + +fun case1 (b: B?){ + b.boo({ C() }) + b.boo({1}) +} + +class B { +// private fun boo(c: () -> C) {} +} +class C + +// FILE: LibCase1.kt +package LibPackCase1.b +import LibPackCase1.a.* +import testPackCase1.B +import testPackCase1.C + +fun B?.boo( c: ()->C) {} //(2) + + +// FILE: LibCase1.kt +package LibPackCase1.a +import testPackCase1.B + +fun B?.boo( c: ()->Int) { //(1) +} + +// FILE: TestCase2.kt +/* + * TESTCASE NUMBER: 2 + */ +package testPackCase2 + +import LibPackCase2.a.* +import LibPackCase2.b.* + +fun case2 (b: B?){ + b.boo({ C() }) + b.boo({1}) +} + +class B { +// private fun boo(c: () -> C) {} +} +class C + +// FILE: LibCase2.kt +package LibPackCase2.b +import LibPackCase2.a.* +import testPackCase2.B +import testPackCase2.C + +fun B?.boo( c: ()->C) {} //(2) + + +// FILE: LibCase2.kt +package LibPackCase2.a +import testPackCase2.B + +fun B?.boo( c: ()->Int) { //(1) +} diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/testsMap.json b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/testsMap.json index e71983100de..83764222989 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/testsMap.json +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/testsMap.json @@ -644,6 +644,14 @@ "unexpectedBehaviour": false, "linkType": "main" }, + { + "specVersion": "0.1-448", + "casesNumber": 1, + "description": "plusAssign as inline function", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.2.kt", + "unexpectedBehaviour": false, + "linkType": "primary" + }, { "specVersion": "0.1-413", "casesNumber": 2, @@ -844,6 +852,70 @@ }, "neg": { "1": [ + { + "specVersion": "0.1-448", + "casesNumber": 2, + "description": "call with lambda as argument", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.1.kt", + "unexpectedBehaviour": false, + "linkType": "primary" + }, + { + "specVersion": "0.1-448", + "casesNumber": 1, + "description": "inline plusAssign functions", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.5.kt", + "unexpectedBehaviour": true, + "linkType": "primary" + }, + { + "specVersion": "0.1-448", + "casesNumber": 2, + "description": "without inline plusAssign functions", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.4.kt", + "unexpectedBehaviour": true, + "linkType": "primary" + }, + { + "specVersion": "0.1-448", + "casesNumber": 1, + "description": "without inline plusAssign functions", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.9.kt", + "unexpectedBehaviour": false, + "linkType": "primary" + }, + { + "specVersion": "0.1-448", + "casesNumber": 1, + "description": "without inline plusAssign functions", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.8.kt", + "unexpectedBehaviour": true, + "linkType": "primary" + }, + { + "specVersion": "0.1-448", + "casesNumber": 1, + "description": "without inline plusAssign functions", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.7.kt", + "unexpectedBehaviour": true, + "linkType": "primary" + }, + { + "specVersion": "0.1-448", + "casesNumber": 1, + "description": "plusAssign as inline function", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.2.kt", + "unexpectedBehaviour": false, + "linkType": "primary" + }, + { + "specVersion": "0.1-448", + "casesNumber": 1, + "description": "without inline plusAssign functions", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.6.kt", + "unexpectedBehaviour": true, + "linkType": "primary" + }, { "specVersion": "0.1-413", "casesNumber": 3, @@ -935,6 +1007,14 @@ "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.1.kt", "unexpectedBehaviour": false, "linkType": "main" + }, + { + "specVersion": "0.1-448", + "casesNumber": 2, + "description": "explicit receiver ambuguity", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.2.kt", + "unexpectedBehaviour": false, + "linkType": "main" } ] }, diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/p-2/neg/2.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/p-2/neg/2.1.fir.kt new file mode 100644 index 00000000000..ef44bdfcb7f --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/p-2/neg/2.1.fir.kt @@ -0,0 +1,39 @@ +// !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 testPackCase1 + +import LibPackCase1.a.boo +import LibPackCase1.b.* + +fun case1 (b: B?){ + b.boo({ C() }) + b.boo({1}) +} + +class B { + private fun boo(c: () -> C) {} +} +class C + +// FILE: LibCase1.kt +package LibPackCase1.b +import LibPackCase1.a.* +import testPackCase1.B +import testPackCase1.C + +fun B?.boo( c: ()->C) {} //(2) + + +// FILE: LibCase1.kt +package LibPackCase1.a +import testPackCase1.B + +fun B?.boo( c: ()->Int) { //(1) +} diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/p-2/neg/2.1.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/p-2/neg/2.1.kt new file mode 100644 index 00000000000..db68d7b68f7 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/p-2/neg/2.1.kt @@ -0,0 +1,49 @@ +// !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-448 + * MAIN LINK: overload-resolution, determining-function-applicability-for-a-specific-call, description -> paragraph 2 -> sentence 2 + * PRIMARY LINKS: overload-resolution, determining-function-applicability-for-a-specific-call, description -> paragraph 4 -> sentence 3 + * SECONDARY LINKS: overload-resolution, determining-function-applicability-for-a-specific-call, description -> paragraph 5 -> sentence 1 + * NUMBER: 1 + * DESCRIPTION: explicit receiver with lambda + */ + +// FILE: TestCase1.kt +/* + * TESTCASE NUMBER: 1 + */ +package testPackCase1 + +import LibPackCase1.a.boo +import LibPackCase1.b.* + +fun case1 (b: B?){ + b.boo({ C() }) + b.boo({1}) +} + +class B { + private fun boo(c: () -> C) {} +} +class C + +// FILE: LibCase1.kt +package LibPackCase1.b +import LibPackCase1.a.* +import testPackCase1.B +import testPackCase1.C + +fun B?.boo( c: ()->C) {} //(2) + + +// FILE: LibCase1.kt +package LibPackCase1.a +import testPackCase1.B + +fun B?.boo( c: ()->Int) { //(1) +} \ No newline at end of file diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/testsMap.json b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/testsMap.json index 24c59c8e8cd..aa80d0b8122 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/testsMap.json +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/testsMap.json @@ -1,6 +1,74 @@ { + "2": { + "neg": { + "2": [ + { + "specVersion": "0.1-448", + "casesNumber": 1, + "description": "without inline plusAssign functions", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.9.kt", + "unexpectedBehaviour": false, + "linkType": "primary" + }, + { + "specVersion": "0.1-448", + "casesNumber": 1, + "description": "explicit receiver with lambda", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/p-2/neg/2.1.kt", + "unexpectedBehaviour": false, + "linkType": "main" + } + ] + } + }, + "4": { + "neg": { + "3": [ + { + "specVersion": "0.1-448", + "casesNumber": 1, + "description": "explicit receiver with lambda", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/p-2/neg/2.1.kt", + "unexpectedBehaviour": false, + "linkType": "primary" + } + ] + } + }, + "5": { + "neg": { + "1": [ + { + "specVersion": "0.1-448", + "casesNumber": 1, + "description": "explicit receiver with lambda", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/p-2/neg/2.1.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + }, + { + "specVersion": "0.1-413", + "casesNumber": 1, + "description": "the case of a call with a callable reference as a not parameter", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/neg/1.1.kt", + "unexpectedBehaviour": false, + "linkType": "primary" + } + ] + } + }, "3": { "neg": { + "1": [ + { + "specVersion": "0.1-413", + "casesNumber": 1, + "description": "the case of a call with a callable reference as a not parameter", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/neg/1.1.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" + } + ], "3": [ { "specVersion": "0.1-152", diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/neg/1.1.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/neg/1.1.kt index a681138e428..4adbbc76bcf 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/neg/1.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/neg/1.1.kt @@ -7,6 +7,8 @@ * * SPEC VERSION: 0.1-413 * MAIN LINK: overload-resolution, resolving-callable-references, resolving-callable-references-not-used-as-arguments-to-a-call -> paragraph 1 -> sentence 1 + * PRIMARY LINKS: overload-resolution, determining-function-applicability-for-a-specific-call, description -> paragraph 5 -> sentence 1 + * SECONDARY LINKS: overload-resolution, determining-function-applicability-for-a-specific-call, description -> paragraph 3 -> sentence 1 * NUMBER: 1 * DESCRIPTION: the case of a call with a callable reference as a not parameter */ diff --git a/compiler/tests-spec/testData/diagnostics/linked/statements/assignments/operator-assignments/testsMap.json b/compiler/tests-spec/testData/diagnostics/linked/statements/assignments/operator-assignments/testsMap.json index 7d4d62c31ae..0900668f8c5 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/statements/assignments/operator-assignments/testsMap.json +++ b/compiler/tests-spec/testData/diagnostics/linked/statements/assignments/operator-assignments/testsMap.json @@ -41,6 +41,14 @@ "path": "compiler/tests-spec/testData/diagnostics/linked/statements/assignments/operator-assignments/p-2/pos/1.1.kt", "unexpectedBehaviour": false, "linkType": "main" + }, + { + "specVersion": "0.1-448", + "casesNumber": 3, + "description": "Non-extension member callables", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.1.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" } ], "2": [ @@ -51,6 +59,14 @@ "path": "compiler/tests-spec/testData/diagnostics/linked/statements/assignments/operator-assignments/p-2/pos/1.1.kt", "unexpectedBehaviour": false, "linkType": "primary" + }, + { + "specVersion": "0.1-448", + "casesNumber": 3, + "description": "Non-extension member callables", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.1.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" } ], "3": [ @@ -61,6 +77,14 @@ "path": "compiler/tests-spec/testData/diagnostics/linked/statements/assignments/operator-assignments/p-2/pos/1.1.kt", "unexpectedBehaviour": false, "linkType": "primary" + }, + { + "specVersion": "0.1-448", + "casesNumber": 3, + "description": "Non-extension member callables", + "path": "compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.1.kt", + "unexpectedBehaviour": false, + "linkType": "secondary" } ] } 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 44cdcc695e3..886fc6b6fb5 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", "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", "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/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", "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", "overloadable-operators", "statements/assignments/simple-assignments", "type-inference/local-type-inference", "type-inference/smart-casts/smart-cast-types", "type-system/subtyping", "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", "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", "type-system/type-kinds/type-parameters"); } @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis") @@ -3388,7 +3388,7 @@ public class DiagnosticsTestSpecGenerated extends AbstractDiagnosticsTestSpec { } public void testAllFilesPresentInOverload_resolution() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "c-level-partition", "determining-function-applicability-for-a-specific-call"); + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "c-level-partition", "determining-function-applicability-for-a-specific-call/rationale"); } @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs") @@ -4145,6 +4145,95 @@ public class DiagnosticsTestSpecGenerated extends AbstractDiagnosticsTestSpec { KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class P_1 extends AbstractDiagnosticsTestSpec { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInP_1() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/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.1.kt") + public void test2_1() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/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/operator-call/p-1/neg/2.2.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/operator-call/p-1/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/operator-call/p-1/neg/2.5.kt"); + } + + @TestMetadata("2.6.kt") + public void test2_6() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.6.kt"); + } + + @TestMetadata("2.7.kt") + public void test2_7() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.7.kt"); + } + + @TestMetadata("2.8.kt") + public void test2_8() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.8.kt"); + } + + @TestMetadata("2.9.kt") + public void test2_9() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.9.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/operator-call/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/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/operator-call/p-1/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/operator-call/p-1/pos/2.2.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/operator-call/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + } + } + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -4625,6 +4714,11 @@ public class DiagnosticsTestSpecGenerated extends AbstractDiagnosticsTestSpec { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.1.kt"); } + @TestMetadata("2.2.kt") + public void test2_2() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.2.kt"); + } + public void testAllFilesPresentInNeg() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @@ -4726,6 +4820,63 @@ public class DiagnosticsTestSpecGenerated extends AbstractDiagnosticsTestSpec { } } + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Determining_function_applicability_for_a_specific_call extends AbstractDiagnosticsTestSpec { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInDetermining_function_applicability_for_a_specific_call() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "rationale"); + } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Description extends AbstractDiagnosticsTestSpec { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInDescription() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/p-2") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class P_2 extends AbstractDiagnosticsTestSpec { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInP_2() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/p-2/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.1.kt") + public void test2_1() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/p-2/neg/2.1.kt"); + } + + public void testAllFilesPresentInNeg() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/p-2/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + } + } + } + } + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) 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 538f4c7cd21..2e29ad0ad51 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", "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", "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/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", "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", "overloadable-operators", "statements/assignments/simple-assignments", "type-inference/local-type-inference", "type-inference/smart-casts/smart-cast-types", "type-system/subtyping", "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", "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", "type-system/type-kinds/type-parameters"); } @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis") @@ -3388,7 +3388,7 @@ public class FirDiagnosticsTestSpecGenerated extends AbstractFirDiagnosticsTestS } public void testAllFilesPresentInOverload_resolution() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "c-level-partition", "determining-function-applicability-for-a-specific-call"); + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "c-level-partition", "determining-function-applicability-for-a-specific-call/rationale"); } @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs") @@ -4145,6 +4145,95 @@ public class FirDiagnosticsTestSpecGenerated extends AbstractFirDiagnosticsTestS KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class P_1 extends AbstractFirDiagnosticsTestSpec { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInP_1() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Neg extends AbstractFirDiagnosticsTestSpec { + 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/operator-call/p-1/neg/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/operator-call/p-1/neg/2.2.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/operator-call/p-1/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/operator-call/p-1/neg/2.5.kt"); + } + + @TestMetadata("2.6.kt") + public void test2_6() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.6.kt"); + } + + @TestMetadata("2.7.kt") + public void test2_7() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.7.kt"); + } + + @TestMetadata("2.8.kt") + public void test2_8() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.8.kt"); + } + + @TestMetadata("2.9.kt") + public void test2_9() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.9.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/operator-call/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Pos extends AbstractFirDiagnosticsTestSpec { + 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/operator-call/p-1/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/operator-call/p-1/pos/2.2.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/operator-call/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + } + } + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -4625,6 +4714,11 @@ public class FirDiagnosticsTestSpecGenerated extends AbstractFirDiagnosticsTestS runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.1.kt"); } + @TestMetadata("2.2.kt") + public void test2_2() throws Exception { + runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.2.kt"); + } + public void testAllFilesPresentInNeg() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @@ -4726,6 +4820,63 @@ public class FirDiagnosticsTestSpecGenerated extends AbstractFirDiagnosticsTestS } } + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Determining_function_applicability_for_a_specific_call extends AbstractFirDiagnosticsTestSpec { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInDetermining_function_applicability_for_a_specific_call() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "rationale"); + } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Description extends AbstractFirDiagnosticsTestSpec { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInDescription() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/p-2") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class P_2 extends AbstractFirDiagnosticsTestSpec { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInP_2() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/p-2/neg") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Neg extends AbstractFirDiagnosticsTestSpec { + 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/determining-function-applicability-for-a-specific-call/description/p-2/neg/2.1.kt"); + } + + public void testAllFilesPresentInNeg() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/p-2/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + } + } + } + } + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) 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 2af30ee136e..696b7770691 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 @@ -25,7 +25,7 @@ public class BlackBoxCodegenTestSpecGenerated extends AbstractBlackBoxCodegenTes } public void testAllFilesPresentInBox() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/codegen/box"), Pattern.compile("^(.+)\\.kt$"), null, true, "helpers", "templates", "linked/exceptions", "linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver", "linked/overloadable-operators"); + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/codegen/box"), Pattern.compile("^(.+)\\.kt$"), null, true, "helpers", "templates", "linked/exceptions", "linked/operator-call", "linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver", "linked/overloadable-operators"); } @TestMetadata("compiler/tests-spec/testData/codegen/box/linked") @@ -37,7 +37,7 @@ public class BlackBoxCodegenTestSpecGenerated extends AbstractBlackBoxCodegenTes } public void testAllFilesPresentInLinked() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked"), Pattern.compile("^(.+)\\.kt$"), null, true, "exceptions", "overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver", "overloadable-operators"); + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked"), Pattern.compile("^(.+)\\.kt$"), null, true, "exceptions", "operator-call", "overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver", "overloadable-operators"); } @TestMetadata("compiler/tests-spec/testData/codegen/box/linked/expressions") @@ -3373,6 +3373,125 @@ public class BlackBoxCodegenTestSpecGenerated extends AbstractBlackBoxCodegenTes KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call"), Pattern.compile("^(.+)\\.kt$"), null, true); } + @TestMetadata("compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class P_1 extends AbstractBlackBoxCodegenTestSpec { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInP_1() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @TestMetadata("compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Neg extends AbstractBlackBoxCodegenTestSpec { + 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/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.1.kt"); + } + + @TestMetadata("2.2.kt") + public void test2_2() throws Exception { + runTest("compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.2.kt"); + } + + @TestMetadata("2.3.kt") + public void test2_3() throws Exception { + runTest("compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.3.kt"); + } + + @TestMetadata("2.4.kt") + public void test2_4() throws Exception { + runTest("compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.4.kt"); + } + + @TestMetadata("2.5.kt") + public void test2_5() throws Exception { + runTest("compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.5.kt"); + } + + @TestMetadata("2.6.kt") + public void test2_6() throws Exception { + runTest("compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.6.kt"); + } + + public void testAllFilesPresentInNeg() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + } + + @TestMetadata("compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Pos extends AbstractBlackBoxCodegenTestSpec { + 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/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.1.kt"); + } + + @TestMetadata("2.10.kt") + public void test2_10() throws Exception { + runTest("compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.10.kt"); + } + + @TestMetadata("2.2.kt") + public void test2_2() throws Exception { + runTest("compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.2.kt"); + } + + @TestMetadata("2.3.kt") + public void test2_3() throws Exception { + runTest("compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.3.kt"); + } + + @TestMetadata("2.4.kt") + public void test2_4() throws Exception { + runTest("compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.4.kt"); + } + + @TestMetadata("2.5.kt") + public void test2_5() throws Exception { + runTest("compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.5.kt"); + } + + @TestMetadata("2.6.kt") + public void test2_6() throws Exception { + runTest("compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.6.kt"); + } + + @TestMetadata("2.7.kt") + public void test2_7() throws Exception { + runTest("compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.7.kt"); + } + + @TestMetadata("2.8.kt") + public void test2_8() throws Exception { + runTest("compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.8.kt"); + } + + @TestMetadata("2.9.kt") + public void test2_9() throws Exception { + runTest("compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.9.kt"); + } + + public void testAllFilesPresentInPos() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + } + } + @TestMetadata("compiler/tests-spec/testData/codegen/box/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class)