diff --git a/compiler/fir/analysis-tests/testData/resolve/problems/invalidCode.kt b/compiler/fir/analysis-tests/testData/resolve/problems/invalidCode.kt index 82ae99940af..17b76848153 100644 --- a/compiler/fir/analysis-tests/testData/resolve/problems/invalidCode.kt +++ b/compiler/fir/analysis-tests/testData/resolve/problems/invalidCode.kt @@ -35,7 +35,7 @@ package d interface I { fun f = C( - .f + .f class C : I // FILE: e.kt diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/coneDiagnosticToFirDiagnostic.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/coneDiagnosticToFirDiagnostic.kt index ddba7722f77..3927469507c 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/coneDiagnosticToFirDiagnostic.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/coneDiagnosticToFirDiagnostic.kt @@ -259,9 +259,7 @@ private fun mapInapplicableCandidateError( ): List { val typeContext = session.typeContext val genericDiagnostic = FirErrors.INAPPLICABLE_CANDIDATE.createOn(source, diagnostic.candidate.symbol) - val diagnostics = diagnostic.candidate.diagnostics.filter { - it.applicability.userRelevantApplicability == diagnostic.applicability.userRelevantApplicability - }.mapNotNull { rootCause -> + val diagnostics = diagnostic.candidate.diagnostics.filter { !it.applicability.isSuccess }.mapNotNull { rootCause -> when (rootCause) { is VarargArgumentOutsideParentheses -> FirErrors.VARARG_OUTSIDE_PARENTHESES.createOn( rootCause.argument.source ?: qualifiedAccessSource @@ -370,12 +368,6 @@ private fun mapInapplicableCandidateError( } } -private val CandidateApplicability.userRelevantApplicability: CandidateApplicability - get() = when (this) { - CandidateApplicability.INAPPLICABLE_ARGUMENTS_MAPPING_ERROR -> CandidateApplicability.INAPPLICABLE - else -> this - } - private fun mapSystemHasContradictionError( session: FirSession, diagnostic: ConeConstraintSystemHasContradiction, diff --git a/compiler/testData/diagnostics/tests/Bounds.fir.kt b/compiler/testData/diagnostics/tests/Bounds.fir.kt index 2efca46f280..b011fbb5408 100644 --- a/compiler/testData/diagnostics/tests/Bounds.fir.kt +++ b/compiler/testData/diagnostics/tests/Bounds.fir.kt @@ -34,7 +34,7 @@ fun test() { bar() bar<Double?>() bar<Double>() - 1.buzz<Double>() + 1.buzz<Double>() } fun foo() {} diff --git a/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver.fir.kt b/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver.fir.kt index 607e6ca2fbf..48420f026b1 100644 --- a/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver.fir.kt +++ b/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver.fir.kt @@ -40,7 +40,7 @@ fun test5() { fun R?.sure() : R = this!! fun test6(l: List?) { - l.sure<T>() + l.sure<T>() } diff --git a/compiler/testData/diagnostics/tests/generics/nullability/expressionsBoundsViolation.fir.kt b/compiler/testData/diagnostics/tests/generics/nullability/expressionsBoundsViolation.fir.kt index 729f13c8f70..b30a2142600 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/expressionsBoundsViolation.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/nullability/expressionsBoundsViolation.fir.kt @@ -13,6 +13,6 @@ fun bar(x: F) { foo1<F>(x) x.foo2() - x.foo2<F>() + x.foo2<F>() } diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt742.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt742.fir.kt index 889e27890fc..401846e5b81 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt742.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt742.fir.kt @@ -9,4 +9,4 @@ fun List.map1(f: (T)-> Q): List? = tail!!.map1(f) fun List.map2(f: (T)-> Q): List? = tail.sure().map2(f) -fun List.map3(f: (T)-> Q): List? = tail.sure<T>().map3(f) +fun List.map3(f: (T)-> Q): List? = tail.sure<T>().map3(f) diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/QualifiedExpressionNullability.fir.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/QualifiedExpressionNullability.fir.kt index 6916a5d33c3..ffd70a09ec6 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/QualifiedExpressionNullability.fir.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/QualifiedExpressionNullability.fir.kt @@ -8,7 +8,7 @@ fun main() { val x: Foo? = null val y: Foo? = null - x.foo(y) + x.foo(y) x!!.foo(y) x.foo(y!!) x!!.foo(y!!) @@ -17,8 +17,8 @@ fun main() { val b: Foo? = null val c: Foo? = null - a.foo(b.foo(c)) - a!!.foo(b.foo(c)) + a.foo(b.foo(c)) + a!!.foo(b.foo(c)) a.foo(b!!.foo(c)) a!!.foo(b!!.foo(c)) a.foo(b.foo(c!!)) diff --git a/compiler/testData/diagnostics/tests/operatorsOverloading/kt13330.fir.kt b/compiler/testData/diagnostics/tests/operatorsOverloading/kt13330.fir.kt index 140bcd68c3a..f28421af28f 100644 --- a/compiler/testData/diagnostics/tests/operatorsOverloading/kt13330.fir.kt +++ b/compiler/testData/diagnostics/tests/operatorsOverloading/kt13330.fir.kt @@ -1,3 +1,3 @@ //KT-13330 AssertionError: Illegal resolved call to variable with invoke -fun foo(exec: (String.() -> Unit)?) = "".exec<caret>() // is test data tag here +fun foo(exec: (String.() -> Unit)?) = "".exec<caret>() // is test data tag here diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/functionExpectedWhenSeveralInvokesExist.fir.kt b/compiler/testData/diagnostics/tests/resolve/invoke/functionExpectedWhenSeveralInvokesExist.fir.kt index 134ad957b31..06a139ed434 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/functionExpectedWhenSeveralInvokesExist.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/functionExpectedWhenSeveralInvokesExist.fir.kt @@ -8,6 +8,6 @@ class SomeClass fun test(identifier: SomeClass, fn: String.() -> Unit) { identifier() identifier(123) - identifier(1, 2) + identifier(1, 2) 1.fn() } diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAndSmartCast.fir.kt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAndSmartCast.fir.kt index 75f6a803bde..46b99951644 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAndSmartCast.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAndSmartCast.fir.kt @@ -11,7 +11,7 @@ fun test(a: A) { (a.x)("") with("") { - a.x() + a.x() (a.x)() if (a.x != null) { a.x() // todo diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/reportFunctionExpectedWhenOneInvokeExist.fir.kt b/compiler/testData/diagnostics/tests/resolve/invoke/reportFunctionExpectedWhenOneInvokeExist.fir.kt index 75f74c6e38a..b2dcb167b24 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/reportFunctionExpectedWhenOneInvokeExist.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/reportFunctionExpectedWhenOneInvokeExist.fir.kt @@ -6,7 +6,7 @@ class SomeClass fun test(identifier: SomeClass, fn: String.() -> Unit) { identifier() - identifier(123) - identifier(1, 2) + identifier(123) + identifier(1, 2) 1.fn() } diff --git a/compiler/testData/diagnostics/tests/resolve/propertyInCompanionOfEnum.fir.kt b/compiler/testData/diagnostics/tests/resolve/propertyInCompanionOfEnum.fir.kt index d855502227c..b2502aa0604 100644 --- a/compiler/testData/diagnostics/tests/resolve/propertyInCompanionOfEnum.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/propertyInCompanionOfEnum.fir.kt @@ -33,7 +33,7 @@ fun foo() { import test.E as U fun bar() { - U.Entry checkType { _<E>() } + U.Entry checkType { _<E>() } U.Entry checkType { _() } U.Companion.Entry checkType { _() } U.NotEntry checkType { _() } diff --git a/compiler/testData/diagnostics/testsWithStdLib/smartcasts/unsoundSmartcast.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/smartcasts/unsoundSmartcast.fir.kt index 0de795dd2a7..e8313ddc9af 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/smartcasts/unsoundSmartcast.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/smartcasts/unsoundSmartcast.fir.kt @@ -36,6 +36,6 @@ operator fun Int.invoke(y: Int, z: Int) {} fun test5() { var x: Int? = 10 x!! - x(if (true) { x = null; 0 } else 0, x) + x(if (true) { x = null; 0 } else 0, x) x.inv() } diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.1.fir.kt index bd4f528b28d..ac281a59a19 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.1.fir.kt @@ -74,7 +74,7 @@ fun case3() { */ fun case4(marker : Marker?) { marker?.foo(y=1) - marker?.foo(x=1)> + marker?.foo(x=1)> } diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.1.fir.kt index 8052a2cf64b..859cd4cc720 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.1.fir.kt @@ -74,7 +74,7 @@ fun case3() { */ fun case4(marker: Marker?) { marker?.foo(y = { 1 }) - marker?.foo(x = { 1 })> + marker?.foo(x = { 1 })> } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/1.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/1.fir.kt index 500b41f9a86..76de8c4006e 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/1.fir.kt @@ -387,7 +387,7 @@ fun case_22(a: (() -> Unit)?) { // TESTCASE NUMBER: 23 fun case_23(a: ((Float) -> Int?)?, b: Float?) { if (a != null !is Boolean && b !== null is Boolean) { - val x = a(b) + val x = a(b) if (x != null) { x x.equals(null) @@ -406,8 +406,8 @@ fun case_23(a: ((Float) -> Int?)?, b: Float?) { // TESTCASE NUMBER: 24 fun case_24(a: ((() -> Unit) -> Unit)?, b: (() -> Unit)?) = if (a !== null is Boolean && b !== null !is Boolean) { - a(?")!>b) - a(b) + a(?")!>b) + a(b) ?")!>b.equals(null) ?")!>b.propT ?")!>b.propAny @@ -450,7 +450,7 @@ fun case_25(b: Boolean) { // TESTCASE NUMBER: 26 fun case_26(a: ((Float) -> Int?)?, b: Float?) { if (a != null == true == false && b != null == true == false) { - val x = a(b) + val x = a(b) if (x != null == true === false) { x x.equals(null) diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/13.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/13.fir.kt index d4fa15e2cf3..e4eb9ae86be 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/13.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/13.fir.kt @@ -24,7 +24,7 @@ fun case_1(x: Class?) { fun case_2() { var x: Class? = 10 x!! - x(if (true) {x=null;0} else 0, x) + x(if (true) {x=null;0} else 0, x) x x.fun_1() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/26.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/26.fir.kt index 79a036b6fab..a8f5f7bca19 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/26.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/26.fir.kt @@ -62,7 +62,7 @@ fun case_4() { fun case_5() { var x: Class? = Class() x!! - x(if (true) {x=null;0} else 0, x) + x(if (true) {x=null;0} else 0, x) x.fun_1() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/2.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/2.fir.kt index 6deee3e3902..f1a41534f51 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/2.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/2.fir.kt @@ -95,7 +95,7 @@ fun case_3(b: Boolean) { // TESTCASE NUMBER: 4 fun case_4(a: ((Float) -> Int?)?, b: Float?) { if (a != null == true && b != null == true || false || false || false || false || false || false || false || false || false) { - val x = a(b) + val x = a(b) ?")!>a.equals(null) ?")!>a.propT ?")!>a.propAny diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/6.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/6.fir.kt index ff3ddef6b1f..8fee42b7e3f 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/6.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/6.fir.kt @@ -603,7 +603,7 @@ fun case_29(x: Boolean) { // TESTCASE NUMBER: 30 fun case_30(a: ((Float) -> Int?)?, b: Float?) { if (implicitNullableNothingProperty != a == true && b != implicitNullableNothingProperty == true || false || false || false || false || false || false || false || false || false) { - val x = a(b) + val x = a(b) if (false || implicitNullableNothingProperty != x == true) { x x.equals(null) diff --git a/plugins/assign-plugin/testData/diagnostics/otherOperators.fir.diag.txt b/plugins/assign-plugin/testData/diagnostics/otherOperators.fir.diag.txt index 37510c71761..0aede0f76e9 100644 --- a/plugins/assign-plugin/testData/diagnostics/otherOperators.fir.diag.txt +++ b/plugins/assign-plugin/testData/diagnostics/otherOperators.fir.diag.txt @@ -22,10 +22,14 @@ /otherOperators.fir.kt:(1057,1066): error: No 'set' operator method providing array access. +/otherOperators.fir.kt:(1117,1130): error: 'operator' modifier is required on 'FirNamedFunctionSymbol /StringProperty.get' in 'get'. + /otherOperators.fir.kt:(1128,1129): error: Too many arguments for 'public final fun /StringProperty.get(): kotlin/String'. /otherOperators.fir.kt:(1131,1133): error: Unresolved reference '+='. +/otherOperators.fir.kt:(1161,1179): error: 'operator' modifier is required on 'FirNamedFunctionSymbol /StringProperty.get' in 'get'. + /otherOperators.fir.kt:(1177,1178): error: Too many arguments for 'public final fun /StringProperty.get(): kotlin/String'. /otherOperators.fir.kt:(1180,1182): error: Unresolved reference '+='. diff --git a/plugins/assign-plugin/testData/diagnostics/otherOperators.fir.kt b/plugins/assign-plugin/testData/diagnostics/otherOperators.fir.kt index 16b2667b6c6..545734a7346 100644 --- a/plugins/assign-plugin/testData/diagnostics/otherOperators.fir.kt +++ b/plugins/assign-plugin/testData/diagnostics/otherOperators.fir.kt @@ -42,8 +42,8 @@ fun `should not effect error reporting for other operators`() { nullTask?.input[0, 0, 0] = StringProperty("Fail") // a?.b[c] += d - task.input[0] += StringProperty("Fail") - nullTask?.input[0] += StringProperty("Fail") + task.input[0] += StringProperty("Fail") + nullTask?.input[0] += StringProperty("Fail") // a[i] = b should not be translated to a.get(i).assign(b) operator fun Task.get(i: Int) = this.input