diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/CallBasedInExpressionGenerator.kt b/compiler/fir/analysis-tests/testData/resolve/expresssions/CallBasedInExpressionGenerator.kt index abb4cda0e57..337300ebe84 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/CallBasedInExpressionGenerator.kt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/CallBasedInExpressionGenerator.kt @@ -15,13 +15,13 @@ class CallBasedInExpressionGenerator( operatorReference: KtSimpleNameExpression ) : InExpressionGenerator { private val resolvedCall = operatorReference.getResolvedCallWithAssert(codegen.bindingContext) - private val isInverted = operatorReference.getReferencedNameElementType() == KtTokens.NOT_IN + private val isInverted = operatorReference.getReferencedNameElementType() == KtTokens.NOT_IN override fun generate(argument: StackValue): BranchedValue = gen(argument).let { if (isInverted) Invert(it) else it } private fun gen(argument: StackValue): BranchedValue = - object : BranchedValue(argument, null, argument.type, Opcodes.IFEQ) { + object : BranchedValue(argument, null, argument.type, Opcodes.IFEQ) { override fun putSelector(type: Type, kotlinType: KotlinType?, v: InstructionAdapter) { invokeFunction(v) coerceTo(type, kotlinType, v) @@ -29,7 +29,7 @@ class CallBasedInExpressionGenerator( override fun condJump(jumpLabel: Label, v: InstructionAdapter, jumpIfFalse: Boolean) { invokeFunction(v) - v.visitJumpInsn(if (jumpIfFalse) Opcodes.IFEQ else Opcodes.IFNE, jumpLabel) + v.visitJumpInsn(if (jumpIfFalse) Opcodes.IFEQ else Opcodes.IFNE, jumpLabel) } private fun invokeFunction(v: InstructionAdapter) { diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/localObjects.kt b/compiler/fir/analysis-tests/testData/resolve/expresssions/localObjects.kt index a90af6e1282..59baf715a22 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/localObjects.kt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/localObjects.kt @@ -18,4 +18,4 @@ fun test() { B.foo() } -val bb = B.foo() +val bb = B.foo() diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/nestedObjects.kt b/compiler/fir/analysis-tests/testData/resolve/expresssions/nestedObjects.kt index 9708e898074..b4988e2e77f 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/nestedObjects.kt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/nestedObjects.kt @@ -6,5 +6,5 @@ object A { object B -val err = B.A.B +val err = B.A.B val correct = A.B.A diff --git a/compiler/fir/analysis-tests/testData/resolve/samConversions/notSamBecauseOfSupertype.kt b/compiler/fir/analysis-tests/testData/resolve/samConversions/notSamBecauseOfSupertype.kt index 016843b8718..6235c6e8a92 100644 --- a/compiler/fir/analysis-tests/testData/resolve/samConversions/notSamBecauseOfSupertype.kt +++ b/compiler/fir/analysis-tests/testData/resolve/samConversions/notSamBecauseOfSupertype.kt @@ -23,7 +23,7 @@ fun main() { x > 1 } - JavaUsage.foo({ it > 1 }) + JavaUsage.foo({ it > 1 }) val x = { x: Int -> x > 1 } diff --git a/compiler/fir/analysis-tests/testData/resolve/typeAliasWithTypeArguments.kt b/compiler/fir/analysis-tests/testData/resolve/typeAliasWithTypeArguments.kt index 5a6f706a61e..15dd68d4062 100644 --- a/compiler/fir/analysis-tests/testData/resolve/typeAliasWithTypeArguments.kt +++ b/compiler/fir/analysis-tests/testData/resolve/typeAliasWithTypeArguments.kt @@ -79,7 +79,7 @@ fun test_5(a: A, in1: In1, in2: In1, in3: In1) { fun test_6(a: A, out1: Out1, out2: Out1, out3: Out1) { out1.value().foo() - out2.value().foo() + out2.value().foo() out3.value().foo() } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ErrorNodeDiagnosticCollectorComponent.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ErrorNodeDiagnosticCollectorComponent.kt index 42eaf831712..ca290950888 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ErrorNodeDiagnosticCollectorComponent.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ErrorNodeDiagnosticCollectorComponent.kt @@ -34,17 +34,28 @@ class ErrorNodeDiagnosticCollectorComponent(collector: AbstractDiagnosticCollect override fun visitErrorNamedReference(errorNamedReference: FirErrorNamedReference, data: CheckerContext) { val source = errorNamedReference.source ?: return - val qualifiedAccessSource = data.qualifiedAccesses.lastOrNull()?.takeIf { + val qualifiedAccess = data.qualifiedAccesses.lastOrNull()?.takeIf { // Use the source of the enclosing FirQualifiedAccessExpression if it is exactly the call to the erroneous callee. it is FirQualifiedAccessExpression && it.calleeReference == errorNamedReference - }?.source + } // Don't report duplicated unresolved reference on annotation entry (already reported on its type) if (source.elementType == KtNodeTypes.ANNOTATION_ENTRY && errorNamedReference.diagnostic is ConeUnresolvedNameError) return // Already reported in FirConventionFunctionCallChecker if (source.kind == FirFakeSourceElementKind.ArrayAccessNameReference && errorNamedReference.diagnostic is ConeUnresolvedNameError ) return - reportFirDiagnostic(errorNamedReference.diagnostic, source, reporter, data, qualifiedAccessSource) + + // If the receiver cannot be resolved, we skip reporting any further problems for this call. + if (qualifiedAccess?.dispatchReceiver.hasUnresolvedNameError() || qualifiedAccess?.extensionReceiver.hasUnresolvedNameError() || qualifiedAccess?.explicitReceiver.hasUnresolvedNameError()) return + + reportFirDiagnostic(errorNamedReference.diagnostic, source, reporter, data, qualifiedAccess?.source) + } + + private fun FirExpression?.hasUnresolvedNameError(): Boolean { + return when ((this?.typeRef as? FirErrorTypeRef)?.diagnostic) { + is ConeUnresolvedNameError -> true + else -> false + } } override fun visitErrorExpression(errorExpression: FirErrorExpression, data: CheckerContext) { diff --git a/compiler/testData/diagnostics/tests/CharacterLiterals.fir.kt b/compiler/testData/diagnostics/tests/CharacterLiterals.fir.kt index e75762bdb11..249092de44a 100644 --- a/compiler/testData/diagnostics/tests/CharacterLiterals.fir.kt +++ b/compiler/testData/diagnostics/tests/CharacterLiterals.fir.kt @@ -6,8 +6,8 @@ fun test(c : Char) { test(' test(0' test('\n') - test('\\') - test('''') + test('\\') + test('''') test('\'') test('\"') } diff --git a/compiler/testData/diagnostics/tests/CompareToWithErrorType.fir.kt b/compiler/testData/diagnostics/tests/CompareToWithErrorType.fir.kt index 316d2bb8dc3..fec2b30356a 100644 --- a/compiler/testData/diagnostics/tests/CompareToWithErrorType.fir.kt +++ b/compiler/testData/diagnostics/tests/CompareToWithErrorType.fir.kt @@ -1,6 +1,6 @@ // !WITH_NEW_INFERENCE fun test() { - if (x > 0) { + if (x > 0) { } } diff --git a/compiler/testData/diagnostics/tests/DeferredTypes.fir.kt b/compiler/testData/diagnostics/tests/DeferredTypes.fir.kt index 7febd7aed4c..9584db9accc 100644 --- a/compiler/testData/diagnostics/tests/DeferredTypes.fir.kt +++ b/compiler/testData/diagnostics/tests/DeferredTypes.fir.kt @@ -1,5 +1,5 @@ // NI_EXPECTED_FILE interface T { - val a = Foo.bar() -} \ No newline at end of file + val a = Foo.bar() +} diff --git a/compiler/testData/diagnostics/tests/PackageQualified.fir.kt b/compiler/testData/diagnostics/tests/PackageQualified.fir.kt index 73136a4d60c..fd6b7ce34c8 100644 --- a/compiler/testData/diagnostics/tests/PackageQualified.fir.kt +++ b/compiler/testData/diagnostics/tests/PackageQualified.fir.kt @@ -25,7 +25,7 @@ package foobar.a // FILE: d.kt package foobar -val x1 = a.a +val x1 = a.a val x2 = foobar.a.a val y1 = foobar.a.b diff --git a/compiler/testData/diagnostics/tests/Unresolved.fir.kt b/compiler/testData/diagnostics/tests/Unresolved.fir.kt index ce9319e4fe7..1acaaa7bee4 100644 --- a/compiler/testData/diagnostics/tests/Unresolved.fir.kt +++ b/compiler/testData/diagnostics/tests/Unresolved.fir.kt @@ -22,11 +22,11 @@ fun testUnresolved() { is String -> a } - for (j in collection) { + for (j in collection) { var i: Int = j i += 1 foo1(j) } } -fun foo1(i: Int) {} \ No newline at end of file +fun foo1(i: Int) {} diff --git a/compiler/testData/diagnostics/tests/annotations/invalidTypesInAnnotationConstructor.fir.kt b/compiler/testData/diagnostics/tests/annotations/invalidTypesInAnnotationConstructor.fir.kt index 02af37dfb8e..c3a34bcd827 100644 --- a/compiler/testData/diagnostics/tests/annotations/invalidTypesInAnnotationConstructor.fir.kt +++ b/compiler/testData/diagnostics/tests/annotations/invalidTypesInAnnotationConstructor.fir.kt @@ -34,7 +34,7 @@ annotation class Ann8(val p1: Array, val p4: Array) annotation class Ann9( - val error: Unresolved = Unresolved.VALUE + val error: Unresolved = Unresolved.VALUE ) diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/field.fir.kt b/compiler/testData/diagnostics/tests/annotations/options/targets/field.fir.kt index 892c511bd7b..f0a3ce8caad 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/field.fir.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/field.fir.kt @@ -28,7 +28,7 @@ abstract class My(@Field arg: Int, @Field val w: Int) { fun foo() {} @Field - val v: Int by Delegates.lazy { 42 } + val v: Int by Delegates.lazy { 42 } } enum class Your { diff --git a/compiler/testData/diagnostics/tests/callableReference/bound/functionCallWithoutArguments.fir.kt b/compiler/testData/diagnostics/tests/callableReference/bound/functionCallWithoutArguments.fir.kt index 484d232daf5..be9c7e33b9e 100644 --- a/compiler/testData/diagnostics/tests/callableReference/bound/functionCallWithoutArguments.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/bound/functionCallWithoutArguments.fir.kt @@ -1 +1 @@ -fun test() = ("").hashCode::hashCode +fun test() = ("").hashCode::hashCode diff --git a/compiler/testData/diagnostics/tests/callableReference/bound/kt12843.fir.kt b/compiler/testData/diagnostics/tests/callableReference/bound/kt12843.fir.kt index d8c6f0dafcf..18df77a2d46 100644 --- a/compiler/testData/diagnostics/tests/callableReference/bound/kt12843.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/bound/kt12843.fir.kt @@ -1,6 +1,6 @@ class Foo { fun bar() {} - fun f() = Unresolved()::bar + fun f() = Unresolved()::bar } -val f: () -> Unit = Unresolved()::foo +val f: () -> Unit = Unresolved()::foo diff --git a/compiler/testData/diagnostics/tests/callableReference/function/unresolved.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/unresolved.fir.kt index 87a57d66c59..fcdcc521530 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/unresolved.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/unresolved.fir.kt @@ -10,15 +10,15 @@ fun test1() { A::bar - B::bar + B::bar } fun test2() { fun foo(x: Any) {} fun foo() {} - Unresolved::foo - foo(Unresolved::foo) - foo(Unresolved::unresolved) + Unresolved::foo + foo(Unresolved::foo) + foo(Unresolved::unresolved) ::unresolved } diff --git a/compiler/testData/diagnostics/tests/callableReference/withQuestionMarks.fir.kt b/compiler/testData/diagnostics/tests/callableReference/withQuestionMarks.fir.kt index 7e4d0e46fd0..8b84f6a1110 100644 --- a/compiler/testData/diagnostics/tests/callableReference/withQuestionMarks.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/withQuestionMarks.fir.kt @@ -4,22 +4,22 @@ fun foo() {} fun main() { - val x1 = logger::info?::print - val x2 = logger?::info?::print - val x3 = logger?::info::print - val x4 = logger?::info?::print?::print?::print?::print?::print?::print?::print?::print?::print?::print - val x5 = logger::info?::print?::print?::print?::print?::print?::print?::print?::print?::print?::print + val x1 = logger::info?::print + val x2 = logger?::info?::print + val x3 = logger?::info::print + val x4 = logger?::info?::print?::print?::print?::print?::print?::print?::print?::print?::print?::print + val x5 = logger::info?::print?::print?::print?::print?::print?::print?::print?::print?::print?::print val x6 = logger!!::info?::print?::print val x7 = logger::info!!::print?::print val x8 = logger?::info!!::print?::print val x9 = logger!!::info?::print?::print - val x10 = logger::info?::print!!::print + val x10 = logger::info?::print!!::print val x11 = logger!!::info!!::print!!::print val x12 = logger?::info!!::print!!::print val x13 = 42?::unresolved?::print val x14 = logger?!!::info?::print?::print - val x15 = logger::info?!!::print?::print + val x15 = logger::info?!!::print?::print val x16 = logger!!?::info?::print?::print val x17 = logger::info!!?::print?::print diff --git a/compiler/testData/diagnostics/tests/classObjects/InnerClassAccessThroughClassObject.fir.kt b/compiler/testData/diagnostics/tests/classObjects/InnerClassAccessThroughClassObject.fir.kt index 68fe795f84c..b9a6940b154 100644 --- a/compiler/testData/diagnostics/tests/classObjects/InnerClassAccessThroughClassObject.fir.kt +++ b/compiler/testData/diagnostics/tests/classObjects/InnerClassAccessThroughClassObject.fir.kt @@ -43,7 +43,7 @@ fun f() { A.Obj A.Companion.Obj2 A.Obj2 - A.Obj2.c + A.Obj2.c A.Nested2 O.O diff --git a/compiler/testData/diagnostics/tests/classObjects/InnerClassAccessThroughEnum_after.fir.kt b/compiler/testData/diagnostics/tests/classObjects/InnerClassAccessThroughEnum_after.fir.kt index 2921d76da13..612ebe7a01f 100644 --- a/compiler/testData/diagnostics/tests/classObjects/InnerClassAccessThroughEnum_after.fir.kt +++ b/compiler/testData/diagnostics/tests/classObjects/InnerClassAccessThroughEnum_after.fir.kt @@ -38,7 +38,7 @@ fun f() { C.E2.B() C.E2.O - C.E3.O.InO + C.E3.O.InO C.O C.O.InO diff --git a/compiler/testData/diagnostics/tests/classObjects/InnerClassAccessThroughEnum_before.fir.kt b/compiler/testData/diagnostics/tests/classObjects/InnerClassAccessThroughEnum_before.fir.kt index 34f21aed8ef..eb4e81f4c17 100644 --- a/compiler/testData/diagnostics/tests/classObjects/InnerClassAccessThroughEnum_before.fir.kt +++ b/compiler/testData/diagnostics/tests/classObjects/InnerClassAccessThroughEnum_before.fir.kt @@ -38,7 +38,7 @@ fun f() { C.E2.B() C.E2.O - C.E3.O.InO + C.E3.O.InO C.O C.O.InO diff --git a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/complexInference.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/complexInference.fir.kt index e9d09e341af..7222a9323b9 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/complexInference.fir.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/complexInference.fir.kt @@ -24,24 +24,24 @@ fun bar(aInstance: A, bInstance: B) { foo(bInstance) { (a, b): A, (c, d) -> - a checkType { _() } - b checkType { _() } + a checkType { _() } + b checkType { _() } c checkType { _() } d checkType { _() } } foo(bInstance) { (a, b), (c, d) -> - a checkType { _() } - b checkType { _() } + a checkType { _() } + b checkType { _() } c checkType { _() } d checkType { _() } } foo(bInstance) { (a, b), (c, d) -> - a checkType { _() } - b checkType { _() } + a checkType { _() } + b checkType { _() } c checkType { _() } d checkType { _() } } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/redeclaration.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/redeclaration.fir.kt index 9b4ea9d4756..77e16b4ffbe 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/redeclaration.fir.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/redeclaration.fir.kt @@ -23,7 +23,7 @@ fun bar() { } foo { (a, b), (c, b) -> - a checkType { _() } + a checkType { _() } b checkType { _() } c checkType { _() } } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/simple.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/simple.fir.kt index 1115485d97c..81d6adabe56 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/simple.fir.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/simple.fir.kt @@ -36,8 +36,8 @@ fun bar() { } foobar { (a, b), (c, d) -> - a checkType { _() } - b checkType { _() } + a checkType { _() } + b checkType { _() } c checkType { _() } d checkType { _() } } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/underscore.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/underscore.fir.kt index afdf43b95f5..5cd7d359a56 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/underscore.fir.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/underscore.fir.kt @@ -8,35 +8,35 @@ fun foo(block: (A) -> Unit) { } fun bar() { foo { (_, b) -> - _.hashCode() + _.hashCode() b checkType { _() } } foo { (a, _) -> a checkType { _() } - _.hashCode() + _.hashCode() } foo { (_, _) -> - _.hashCode() + _.hashCode() } foo { (_: Int, b: String) -> - _.hashCode() + _.hashCode() b checkType { _() } } foo { (a: Int, _: String) -> a checkType { _() } - _.hashCode() + _.hashCode() } foo { (_: Int, _: String) -> - _.hashCode() + _.hashCode() } foo { (_, _): A -> - _.hashCode() + _.hashCode() } foo { (`_`, _) -> @@ -52,12 +52,12 @@ fun bar() { } foo { (_: String, b) -> - _.hashCode() + _.hashCode() b checkType { _() } } foo { (_, b): B -> - _.hashCode() + _.hashCode() b checkType { _() } } } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/unusedParameters.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/unusedParameters.fir.kt index db23c7d5f31..5b43ff7c912 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/unusedParameters.fir.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/unusedParameters.fir.kt @@ -32,12 +32,12 @@ fun bar() { } foobar { (a, b), (c, d) -> - a checkType { _() } + a checkType { _() } d checkType { _() } } foobar { (a, b), (c, d) -> - b checkType { _() } + b checkType { _() } c checkType { _() } } } diff --git a/compiler/testData/diagnostics/tests/imports/ClassClashStarImport.fir.kt b/compiler/testData/diagnostics/tests/imports/ClassClashStarImport.fir.kt index 4d6a9736661..bacfed58eb4 100644 --- a/compiler/testData/diagnostics/tests/imports/ClassClashStarImport.fir.kt +++ b/compiler/testData/diagnostics/tests/imports/ClassClashStarImport.fir.kt @@ -71,6 +71,6 @@ fun test(b: B) { val b_3 = B() b_3.m2() - val b_4 = a.B() + val b_4 = a.B() b_4.m2() } diff --git a/compiler/testData/diagnostics/tests/incompleteCode/controlStructuresErrors.fir.kt b/compiler/testData/diagnostics/tests/incompleteCode/controlStructuresErrors.fir.kt index 06718ca85dc..639b8d15dc2 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/controlStructuresErrors.fir.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/controlStructuresErrors.fir.kt @@ -3,18 +3,18 @@ fun test1() { if (rr) { if (l) { - a.q() + a.q() } else { - a.w() + a.w() } } else { if (n) { - a.t() + a.t() } else { - a.u() + a.u() } } } diff --git a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/arrayExpression.fir.kt b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/arrayExpression.fir.kt index a62c7f0d096..a11daee0313 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/arrayExpression.fir.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/arrayExpression.fir.kt @@ -4,5 +4,5 @@ package bar fun main() { class Some - Some[] names = ["ads"] + Some[] names = ["ads"] } diff --git a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/valWithNoNameInBlock.fir.kt b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/valWithNoNameInBlock.fir.kt deleted file mode 100644 index 8d48bd43e6f..00000000000 --- a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/valWithNoNameInBlock.fir.kt +++ /dev/null @@ -1,50 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE - -fun println(x: String) { -} - -fun run(block: () -> Unit) {} - -val propertyNameOnTheNextLine = 1 - -fun foo() { - val - println("abc") - - val - run { - println("abc") - } - - val - if (1 == 1) { - - } - - val - (1 + 2) - - // `propertyNameOnTheNextLine` parsed as simple name expression - val - propertyNameOnTheNextLine - - val - // comment - propertyNameOnTheNextLine - - val /* comment */ - propertyNameOnTheNextLine - - // Correct properties - val - property1 = 1 - - val - propertyWithBy by lazy { 1 } - - val - propertyWithType: Int - - val - (a, b) = 1 -} diff --git a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/valWithNoNameInBlock.kt b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/valWithNoNameInBlock.kt index 888589958ef..1f09e94fb7f 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/valWithNoNameInBlock.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/valWithNoNameInBlock.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE fun println(x: String) { diff --git a/compiler/testData/diagnostics/tests/incompleteCode/pseudocodeTraverseNextInstructions.fir.kt b/compiler/testData/diagnostics/tests/incompleteCode/pseudocodeTraverseNextInstructions.fir.kt index 18062c5cbda..4077f374e3c 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/pseudocodeTraverseNextInstructions.fir.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/pseudocodeTraverseNextInstructions.fir.kt @@ -1,7 +1,7 @@ package b fun foo() { - for (i in collection) { + for (i in collection) { { break } diff --git a/compiler/testData/diagnostics/tests/incompleteCode/unresolvedOperation.fir.kt b/compiler/testData/diagnostics/tests/incompleteCode/unresolvedOperation.fir.kt index c314de08b1e..fe69e91f0e4 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/unresolvedOperation.fir.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/unresolvedOperation.fir.kt @@ -1,4 +1,4 @@ fun foo(a: Int) { - !bbb + !bbb bbb + a -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/infos/SmartCasts.fir.kt b/compiler/testData/diagnostics/tests/infos/SmartCasts.fir.kt index 90242dc54a5..2c7a28cbc00 100644 --- a/compiler/testData/diagnostics/tests/infos/SmartCasts.fir.kt +++ b/compiler/testData/diagnostics/tests/infos/SmartCasts.fir.kt @@ -89,17 +89,17 @@ fun f13(a : A?) { } else { a?.foo() - c.bar() + c.bar() } a?.foo() if (!(a is B)) { a?.foo() - c.bar() + c.bar() } else { a.foo() - c.bar() + c.bar() } a?.foo() @@ -109,7 +109,7 @@ fun f13(a : A?) { } else { a?.foo() - c.bar() + c.bar() } if (!(a is B) || !(a is C)) { diff --git a/compiler/testData/diagnostics/tests/inline/nonPublicMember/kt14887.fir.kt b/compiler/testData/diagnostics/tests/inline/nonPublicMember/kt14887.fir.kt index 60b03648e04..30b658a5860 100644 --- a/compiler/testData/diagnostics/tests/inline/nonPublicMember/kt14887.fir.kt +++ b/compiler/testData/diagnostics/tests/inline/nonPublicMember/kt14887.fir.kt @@ -1,6 +1,6 @@ inline fun foo() { - unresolved().another - unresolved().another() + unresolved().another + unresolved().another() } fun main() { diff --git a/compiler/testData/diagnostics/tests/inner/nestedClassAccessedViaInstanceReference.fir.kt b/compiler/testData/diagnostics/tests/inner/nestedClassAccessedViaInstanceReference.fir.kt index 5a56033aae3..afe58ec4573 100644 --- a/compiler/testData/diagnostics/tests/inner/nestedClassAccessedViaInstanceReference.fir.kt +++ b/compiler/testData/diagnostics/tests/inner/nestedClassAccessedViaInstanceReference.fir.kt @@ -27,27 +27,27 @@ fun test(with: WithClassObject, without: WithoutClassObject, obj: Obj) { with.Nested() with.NestedWithClassObject with.NestedWithClassObject() - with.NestedWithClassObject.foo() - with.NestedEnum.A + with.NestedWithClassObject.foo() + with.NestedEnum.A with.NestedObj with.NestedObj() - with.NestedObj.foo() + with.NestedObj.foo() without.Nested() without.NestedWithClassObject without.NestedWithClassObject() - without.NestedWithClassObject.foo() - without.NestedEnum.A + without.NestedWithClassObject.foo() + without.NestedEnum.A without.NestedObj without.NestedObj() - without.NestedObj.foo() + without.NestedObj.foo() obj.Nested() obj.NestedWithClassObject obj.NestedWithClassObject() - obj.NestedWithClassObject.foo() - obj.NestedEnum.A + obj.NestedWithClassObject.foo() + obj.NestedEnum.A obj.NestedObj obj.NestedObj() - obj.NestedObj.foo() + obj.NestedObj.foo() } diff --git a/compiler/testData/diagnostics/tests/j+k/differentFilename.fir.kt b/compiler/testData/diagnostics/tests/j+k/differentFilename.fir.kt index 59ed771217c..9533eb94d34 100644 --- a/compiler/testData/diagnostics/tests/j+k/differentFilename.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/differentFilename.fir.kt @@ -22,5 +22,5 @@ fun main(x: A) { x.b().bar() x.f().foobaz() - D().baz() + D().baz() } diff --git a/compiler/testData/diagnostics/tests/namedArguments/namedArgumentsAndDefaultValues.fir.kt b/compiler/testData/diagnostics/tests/namedArguments/namedArgumentsAndDefaultValues.fir.kt index 01c0d4c33e0..cc03090bca2 100644 --- a/compiler/testData/diagnostics/tests/namedArguments/namedArgumentsAndDefaultValues.fir.kt +++ b/compiler/testData/diagnostics/tests/namedArguments/namedArgumentsAndDefaultValues.fir.kt @@ -22,6 +22,6 @@ fun test() { bar(1, z = "", y = 2) bar(z = "", 1) bar(1, zz = "", - zz.foo + zz.foo ) -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/objects/ObjectsLocal.fir.kt b/compiler/testData/diagnostics/tests/objects/ObjectsLocal.fir.kt index 3072349f9f2..03b71efdccd 100644 --- a/compiler/testData/diagnostics/tests/objects/ObjectsLocal.fir.kt +++ b/compiler/testData/diagnostics/tests/objects/ObjectsLocal.fir.kt @@ -22,4 +22,4 @@ fun test() { B.foo() } -val bb = B.foo() \ No newline at end of file +val bb = B.foo() diff --git a/compiler/testData/diagnostics/tests/objects/ObjectsNested.fir.kt b/compiler/testData/diagnostics/tests/objects/ObjectsNested.fir.kt index faf7d4a6cd3..9e360521201 100644 --- a/compiler/testData/diagnostics/tests/objects/ObjectsNested.fir.kt +++ b/compiler/testData/diagnostics/tests/objects/ObjectsNested.fir.kt @@ -26,4 +26,4 @@ val a = A val b = B val c = A.B val d = A.B.A -val e = B.A.B \ No newline at end of file +val e = B.A.B diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesNew.fir.kt b/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesNew.fir.kt index e77ba8ad817..e87cbda0066 100644 --- a/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesNew.fir.kt +++ b/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesNew.fir.kt @@ -115,28 +115,28 @@ class C : O.B() { val n = FromCompanionC::foo // INVISIBLE: direct superclasses themselves. - val a = A::foo - val b = A::foo + val a = A::foo + val b = A::foo // DEPRECATED: Classifiers from companions of direct superclasses - val e = FromCompanionA::foo - val f = FromCompanionB::foo + val e = FromCompanionA::foo + val f = FromCompanionB::foo // INVISIBLE: "cousin" supertypes themselves - val g = Alpha::foo - val h = Beta::foo - val i = Gamma::foo + val g = Alpha::foo + val h = Beta::foo + val i = Gamma::foo // DEPRECATED: classifiers from "cousin" superclasses - val k = FromAlpha::foo - val l = FromBeta::foo - val m = FromGamma::foo + val k = FromAlpha::foo + val l = FromBeta::foo + val m = FromGamma::foo // INVISIBLE: We don't see classifiers from companions of "cousin" superclasses - val o = FromCompanionAlpha::foo - val p = FromCompanionBeta::foo - val q = FromCompanionGamma::foo + val o = FromCompanionAlpha::foo + val p = FromCompanionBeta::foo + val q = FromCompanionGamma::foo // DEPRECATED: Classifiers from supertypes of our own companion - val r = FromDelta::foo + val r = FromDelta::foo } diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesOld.fir.kt b/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesOld.fir.kt index 56f5b1df034..7aee6b1f5fd 100644 --- a/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesOld.fir.kt +++ b/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesOld.fir.kt @@ -115,28 +115,28 @@ class C : O.B() { val n = FromCompanionC::foo // INVISIBLE: direct superclasses themselves. - val a = A::foo - val b = A::foo + val a = A::foo + val b = A::foo // DEPRECATED: Classifiers from companions of direct superclasses - val e = FromCompanionA::foo - val f = FromCompanionB::foo + val e = FromCompanionA::foo + val f = FromCompanionB::foo // INVISIBLE: "cousin" supertypes themselves - val g = Alpha::foo - val h = Beta::foo - val i = Gamma::foo + val g = Alpha::foo + val h = Beta::foo + val i = Gamma::foo // DEPRECATED: classifiers from "cousin" superclasses - val k = FromAlpha::foo - val l = FromBeta::foo - val m = FromGamma::foo + val k = FromAlpha::foo + val l = FromBeta::foo + val m = FromGamma::foo // INVISIBLE: We don't see classifiers from companions of "cousin" superclasses - val o = FromCompanionAlpha::foo - val p = FromCompanionBeta::foo - val q = FromCompanionGamma::foo + val o = FromCompanionAlpha::foo + val p = FromCompanionBeta::foo + val q = FromCompanionGamma::foo // DEPRECATED: Classifiers from supertypes of our own companion - val r = FromDelta::foo + val r = FromDelta::foo } diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesOldComplexCases.fir.kt b/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesOldComplexCases.fir.kt index 132c34e31b7..f433a440caa 100644 --- a/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesOldComplexCases.fir.kt +++ b/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesOldComplexCases.fir.kt @@ -12,7 +12,7 @@ object A { } class Derived : Base() { - val a = FromBaseCompanion::foo + val a = FromBaseCompanion::foo } } @@ -30,7 +30,7 @@ object B { } class Derived : Base() { - val a = FromBaseCompanion::foo + val a = FromBaseCompanion::foo } } @@ -48,7 +48,7 @@ object C { } class Derived : Base() { - val a = FromBaseCompanion::foo + val a = FromBaseCompanion::foo } } @@ -64,6 +64,6 @@ object D { } class Derived : Base() { - val a = FromBaseCompanion::foo + val a = FromBaseCompanion::foo } } diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/elvis.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/elvis.fir.kt index 85fd8105cea..e9ad65b2bfa 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/elvis.fir.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/elvis.fir.kt @@ -61,7 +61,7 @@ fun test() { takeNotNull(J.getNAny() ?: J()) val x = unresolved ?: null - val y = unresolved.foo ?: return + val y = unresolved.foo ?: return } fun takeNotNull(s: J) {} diff --git a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/primaryConstructorParameter.fir.kt b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/primaryConstructorParameter.fir.kt index 45c62b274d7..6bddfb22a0e 100644 --- a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/primaryConstructorParameter.fir.kt +++ b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/primaryConstructorParameter.fir.kt @@ -19,5 +19,5 @@ class C(p: Any, val v: Any) { var test5 get() { return p } - set(nv) { p.let {} } -} \ No newline at end of file + set(nv) { p.let {} } +} diff --git a/compiler/testData/diagnostics/tests/qualifiedExpression/calleeExpressionAsCallExpression.fir.kt b/compiler/testData/diagnostics/tests/qualifiedExpression/calleeExpressionAsCallExpression.fir.kt index 77afc514e0c..3d99787f9d9 100644 --- a/compiler/testData/diagnostics/tests/qualifiedExpression/calleeExpressionAsCallExpression.fir.kt +++ b/compiler/testData/diagnostics/tests/qualifiedExpression/calleeExpressionAsCallExpression.fir.kt @@ -1,2 +1,2 @@ // !WITH_NEW_INFERENCE -val unwrapped = some<sdf()()::unwrap +val unwrapped = some<sdf()()::unwrap diff --git a/compiler/testData/diagnostics/tests/recovery/absentLeftHandSide.fir.kt b/compiler/testData/diagnostics/tests/recovery/absentLeftHandSide.fir.kt index 3919a089238..0f6952f867d 100644 --- a/compiler/testData/diagnostics/tests/recovery/absentLeftHandSide.fir.kt +++ b/compiler/testData/diagnostics/tests/recovery/absentLeftHandSide.fir.kt @@ -1,6 +1,6 @@ // !WITH_NEW_INFERENCE fun import() { - import a.* + import a.* } fun composite() { @@ -8,9 +8,9 @@ fun composite() { } fun html() { - <html></html> + <html></html> } fun html1() { - <html></html>html + <html></html>html } diff --git a/compiler/testData/diagnostics/tests/regressions/kt13685.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt13685.fir.kt index 11a5eda6d23..eaa4343fca8 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt13685.fir.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt13685.fir.kt @@ -3,5 +3,5 @@ fun foo() { val text: List = null!! - text.map Any?::toString + text.map Any?::toString } diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeOnVariableWithExtensionFunctionType.fir.kt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeOnVariableWithExtensionFunctionType.fir.kt index cd0235c4b5e..f0c2f5f5486 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeOnVariableWithExtensionFunctionType.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/invokeOnVariableWithExtensionFunctionType.fir.kt @@ -59,7 +59,7 @@ fun test(a: A, b: B) { b.(foo)() - (b.foo)() + (b.foo)() foo(b) (foo)(b) diff --git a/compiler/testData/diagnostics/tests/resolve/resolveTypeArgsForUnresolvedCall.fir.kt b/compiler/testData/diagnostics/tests/resolve/resolveTypeArgsForUnresolvedCall.fir.kt index 4994cdbaeba..2cf1bfe28be 100644 --- a/compiler/testData/diagnostics/tests/resolve/resolveTypeArgsForUnresolvedCall.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/resolveTypeArgsForUnresolvedCall.fir.kt @@ -1,4 +1,4 @@ fun foo() { - x.yyy<XXX>() - x.yyy() -} \ No newline at end of file + x.yyy<XXX>() + x.yyy() +} diff --git a/compiler/testData/diagnostics/tests/samConversions/OverloadPriority.fir.kt b/compiler/testData/diagnostics/tests/samConversions/OverloadPriority.fir.kt index 8e4fd966f51..7d3beabb5c4 100644 --- a/compiler/testData/diagnostics/tests/samConversions/OverloadPriority.fir.kt +++ b/compiler/testData/diagnostics/tests/samConversions/OverloadPriority.fir.kt @@ -22,9 +22,9 @@ public interface J { // FILE: 1.kt fun test(j: J) { - j.foo({ it checkType { _() }; "" }, "") checkType { _() } + j.foo({ it checkType { _() }; "" }, "") checkType { _() } - j.bas({ it checkType { _() }; "" }, "") checkType { _() } + j.bas({ it checkType { _() }; "" }, "") checkType { _() } // NI: TODO j.bar { it checkType { _() }; "" } checkType { _() } diff --git a/compiler/testData/diagnostics/tests/samConversions/OverloadPriorityKT.fir.kt b/compiler/testData/diagnostics/tests/samConversions/OverloadPriorityKT.fir.kt index b2d9a1b570a..c13f3796a33 100644 --- a/compiler/testData/diagnostics/tests/samConversions/OverloadPriorityKT.fir.kt +++ b/compiler/testData/diagnostics/tests/samConversions/OverloadPriorityKT.fir.kt @@ -21,9 +21,9 @@ interface K { } fun test(k: K) { - k.foo { it checkType { _() }; "" } checkType { _() } + k.foo { it checkType { _() }; "" } checkType { _() } - k.bas { it checkType { _() }; "" } checkType { _() } + k.bas { it checkType { _() }; "" } checkType { _() } // NI: TODO k.bar { it checkType { _() }; "" } checkType { _() } diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/nestedCompanionClassVsNested.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/nestedCompanionClassVsNested.fir.kt index b350dcdcbdb..e382ae02d06 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/nestedCompanionClassVsNested.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/nestedCompanionClassVsNested.fir.kt @@ -28,7 +28,7 @@ open class A { class Simple: A() { init { Y().A_Y() - Z().A_C_Z() + Z().A_C_Z() } } diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/nestedCompanionClassVsNestedJava.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/nestedCompanionClassVsNestedJava.fir.kt index 410296adbb0..9e87dcdd09f 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/nestedCompanionClassVsNestedJava.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/nestedCompanionClassVsNestedJava.fir.kt @@ -42,6 +42,6 @@ class Y: C() { init { Y().A_Y() - Z().A_C_Z() + Z().A_C_Z() } } diff --git a/compiler/testData/diagnostics/tests/scopes/kt900.fir.kt b/compiler/testData/diagnostics/tests/scopes/kt900.fir.kt index 9e78b68bbf3..fd97d62549a 100644 --- a/compiler/testData/diagnostics/tests/scopes/kt900.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/kt900.fir.kt @@ -5,11 +5,11 @@ package a fun foo() { val b : B = B() //only B() is unresolved, but in ": B" and "B.foo()" B should also be unresolved - B.foo() + B.foo() - P.foo() + P.foo() - M.bar() + M.bar() } class A() { diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/innerInstanceCreation.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/innerInstanceCreation.fir.kt index 690acf8d810..b6f7ae8f977 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/innerInstanceCreation.fir.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/innerInstanceCreation.fir.kt @@ -6,6 +6,6 @@ class Outer { } constructor(x: Int) - constructor(x: Int, y: Int, z: Int = x + Inner().prop + this.Inner().prop) : - this(x + Inner().prop + this.Inner().prop) + constructor(x: Int, y: Int, z: Int = x + Inner().prop + this.Inner().prop) : + this(x + Inner().prop + this.Inner().prop) } diff --git a/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/unstableSmartCast.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/unstableSmartCast.fir.kt index ae481e57005..f5fbc030695 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/unstableSmartCast.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/unstableSmartCast.fir.kt @@ -33,6 +33,6 @@ fun test() { x.baz(1).checkType { _() } x.baz(1, 2) - x.foobar().checkType { _() } + x.foobar().checkType { _() } } } diff --git a/compiler/testData/diagnostics/tests/sourceCompatibility/apiVersion/typealiasesAsCompanionObjects.fir.kt b/compiler/testData/diagnostics/tests/sourceCompatibility/apiVersion/typealiasesAsCompanionObjects.fir.kt index af4f71dad8c..c17ec72b069 100644 --- a/compiler/testData/diagnostics/tests/sourceCompatibility/apiVersion/typealiasesAsCompanionObjects.fir.kt +++ b/compiler/testData/diagnostics/tests/sourceCompatibility/apiVersion/typealiasesAsCompanionObjects.fir.kt @@ -12,4 +12,4 @@ typealias CA = C val test1 = CA val test2 = CA.Companion val test3 = CA.x -val test4 = CA.Companion.x +val test4 = CA.Companion.x diff --git a/compiler/testData/diagnostics/tests/sourceCompatibility/noBoundCallableReferences/qualifiedJavaClassLiteralInKClassExtension.fir.kt b/compiler/testData/diagnostics/tests/sourceCompatibility/noBoundCallableReferences/qualifiedJavaClassLiteralInKClassExtension.fir.kt index 7655e84d0b8..37d2199f810 100644 --- a/compiler/testData/diagnostics/tests/sourceCompatibility/noBoundCallableReferences/qualifiedJavaClassLiteralInKClassExtension.fir.kt +++ b/compiler/testData/diagnostics/tests/sourceCompatibility/noBoundCallableReferences/qualifiedJavaClassLiteralInKClassExtension.fir.kt @@ -7,5 +7,5 @@ val KClass.java: Class get() = null!! val KClass.javaObjectType: Class get() { - return java.lang.Class::class.java as Class + return java.lang.Class::class.java as Class } diff --git a/compiler/testData/diagnostics/tests/sourceCompatibility/noBoundCallableReferences/qualifiedJavaClassReferenceInKClassExtension.fir.kt b/compiler/testData/diagnostics/tests/sourceCompatibility/noBoundCallableReferences/qualifiedJavaClassReferenceInKClassExtension.fir.kt index fbac2590086..c1d56a75632 100644 --- a/compiler/testData/diagnostics/tests/sourceCompatibility/noBoundCallableReferences/qualifiedJavaClassReferenceInKClassExtension.fir.kt +++ b/compiler/testData/diagnostics/tests/sourceCompatibility/noBoundCallableReferences/qualifiedJavaClassReferenceInKClassExtension.fir.kt @@ -6,5 +6,5 @@ val KClass.java: Class get() = null!! val KClass.foo: Any? get() { - return java.lang.Integer::hashCode + return java.lang.Integer::hashCode } diff --git a/compiler/testData/diagnostics/tests/testWithModifiedMockJdk/notConsideredMethod.fir.kt b/compiler/testData/diagnostics/tests/testWithModifiedMockJdk/notConsideredMethod.fir.kt index bba63299a6f..c12fb741a3f 100644 --- a/compiler/testData/diagnostics/tests/testWithModifiedMockJdk/notConsideredMethod.fir.kt +++ b/compiler/testData/diagnostics/tests/testWithModifiedMockJdk/notConsideredMethod.fir.kt @@ -7,7 +7,7 @@ interface A : MutableCollection { } fun foo(x: MutableCollection, y: Collection, z: A) { - x.nonExistingMethod(1).checkType { _() } + x.nonExistingMethod(1).checkType { _() } y.nonExistingMethod("") z.nonExistingMethod("") } diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasAsQualifier.fir.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasAsQualifier.fir.kt index 0171de106b1..507eb93606a 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasAsQualifier.fir.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasAsQualifier.fir.kt @@ -13,9 +13,9 @@ class C { } } -val c = C.Self.Self() -val n = C.Self.Nested() -val x = C.Self.X -val n2 = C.Nested.Root.Nested.N2() -val ic = C.Self.InCompanion() -val ok = C.Self.ok +val c = C.Self.Self() +val n = C.Self.Nested() +val x = C.Self.X +val n2 = C.Nested.Root.Nested.N2() +val ic = C.Self.InCompanion() +val ok = C.Self.ok diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasesInQualifiers.fir.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasesInQualifiers.fir.kt index bd188bbbf8d..7af7d47da05 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasesInQualifiers.fir.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasesInQualifiers.fir.kt @@ -53,7 +53,7 @@ fun foo( test.ClassAlias::func test.ClassSample.Nested::func - test.ClassAlias.Nested::func + test.ClassAlias.Nested::func test.ObjectSample::Nested test.ObjectAlias::Nested @@ -62,7 +62,7 @@ fun foo( test.ObjectAlias::func test.ObjectSample.Nested::func - test.ObjectAlias.Nested::func + test.ObjectAlias.Nested::func test.EnumSample::Nested test.EnumAlias::Nested @@ -71,5 +71,5 @@ fun foo( test.EnumAlias::func test.EnumSample.Nested::func - test.EnumAlias.Nested::func + test.EnumAlias.Nested::func } diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/recursiveContractCustomContractFunction.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/recursiveContractCustomContractFunction.fir.kt index fc4bce32a68..34b542a79b2 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/recursiveContractCustomContractFunction.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/recursiveContractCustomContractFunction.fir.kt @@ -32,7 +32,7 @@ fun case4() { run { s = "hello" } - s.length + s.length } } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt18292.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt18292.fir.kt index f0ee16f3589..754ac2c36e5 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt18292.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt18292.fir.kt @@ -14,6 +14,6 @@ suspend fun fib(n: Long) = async { when { n < 2 -> n - else -> fib(n - 1).await() + fib(n - 2).await() + else -> fib(n - 1).await() + fib(n - 2).await() } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/kt9078.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/kt9078.fir.kt index 37b51abd332..27ba075a9ad 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/kt9078.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/kt9078.fir.kt @@ -3,7 +3,7 @@ abstract class KFunctionKt9005WorkAround(private val _functionInsta private val _reflectedFunction: kotlin.reflect.KFunction = _functionInstance.reflect() ?: throw IllegalStateException("") private val _parameters: List = run { - _functionInstance.javaClass.methods.first().parameters.map { + _functionInstance.javaClass.methods.first().parameters.map { object : kotlin.reflect.KParameter { override val index: Int = 0 } diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-2/neg/1.2.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-2/neg/1.2.fir.kt index a989d87fa8b..5250e017dc5 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-2/neg/1.2.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-2/neg/1.2.fir.kt @@ -5,25 +5,25 @@ val value_1 = E0 val value_2 = e000 // TESTCASE NUMBER: 3 -val value_3 = E+0 +val value_3 = E+0 // TESTCASE NUMBER: 4 val value_4 = e00 // TESTCASE NUMBER: 5 -val value_5 = e+1 +val value_5 = e+1 // TESTCASE NUMBER: 6 val value_6 = e22 // TESTCASE NUMBER: 7 -val value_7 = E-333 +val value_7 = E-333 // TESTCASE NUMBER: 8 val value_8 = e4444 // TESTCASE NUMBER: 9 -val value_9 = e-55555 +val value_9 = e-55555 // TESTCASE NUMBER: 10 val value_10 = e666666 @@ -32,7 +32,7 @@ val value_10 = e666666 val value_11 = E7777777 // TESTCASE NUMBER: 12 -val value_12 = e-88888888 +val value_12 = e-88888888 // TESTCASE NUMBER: 13 -val value_13 = E+999999999 +val value_13 = E+999999999 diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-2/neg/1.3.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-2/neg/1.3.fir.kt index 6522cfa280b..62e75aa385f 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-2/neg/1.3.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-2/neg/1.3.fir.kt @@ -5,25 +5,25 @@ val value_1 = E0f val value_2 = e000F // TESTCASE NUMBER: 3 -val value_3 = E+0f +val value_3 = E+0f // TESTCASE NUMBER: 4 val value_4 = e00f // TESTCASE NUMBER: 5 -val value_5 = e+1F +val value_5 = e+1F // TESTCASE NUMBER: 6 val value_6 = e22F // TESTCASE NUMBER: 7 -val value_7 = E-333F +val value_7 = E-333F // TESTCASE NUMBER: 8 val value_8 = e4444f // TESTCASE NUMBER: 9 -val value_9 = e-55555f +val value_9 = e-55555f // TESTCASE NUMBER: 10 val value_10 = e666666F @@ -32,7 +32,7 @@ val value_10 = e666666F val value_11 = E7777777f // TESTCASE NUMBER: 12 -val value_12 = e-88888888F +val value_12 = e-88888888F // TESTCASE NUMBER: 13 -val value_13 = E+999999999F +val value_13 = E+999999999F 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 8b0ec28fd57..986488008d0 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 @@ -191,7 +191,7 @@ fun case_13(x: otherpackage.Case13?) = class Case14 { val x: otherpackage.Case14? init { - x = otherpackage.Case14() + x = otherpackage.Case14() } } diff --git a/idea/testData/checker/LocalObjects.fir.kt b/idea/testData/checker/LocalObjects.fir.kt new file mode 100644 index 00000000000..09ad82edd1d --- /dev/null +++ b/idea/testData/checker/LocalObjects.fir.kt @@ -0,0 +1,21 @@ + object A { + val x : Int = 0 + } + + open class Foo { + fun foo() : Int = 1 + } + + fun test() { + A.x + val b = object : Foo() { + } + b.foo() + + object B { + fun foo() {} + } + B.foo() + } + + val bb = B.foo() diff --git a/idea/testData/checker/LocalObjects.kt b/idea/testData/checker/LocalObjects.kt index 5ef4a7a617f..54adfe831ff 100644 --- a/idea/testData/checker/LocalObjects.kt +++ b/idea/testData/checker/LocalObjects.kt @@ -1,5 +1,3 @@ -// FIR_IDENTICAL -// FIR_COMPARISON object A { val x : Int = 0 } @@ -20,4 +18,4 @@ B.foo() } - val bb = B.foo() + val bb = B.foo() diff --git a/idea/testData/checker/NestedObjects.fir.kt b/idea/testData/checker/NestedObjects.fir.kt index bcc77fbb238..6232df7b6a2 100644 --- a/idea/testData/checker/NestedObjects.fir.kt +++ b/idea/testData/checker/NestedObjects.fir.kt @@ -25,4 +25,4 @@ package nestedObjects val b = B val c = A.B val d = A.B.A - val e = B.A.B + val e = B.A.B diff --git a/idea/testData/checker/Unresolved.fir.kt b/idea/testData/checker/Unresolved.fir.kt index 9a089ddb090..1cc971d3c58 100644 --- a/idea/testData/checker/Unresolved.fir.kt +++ b/idea/testData/checker/Unresolved.fir.kt @@ -23,11 +23,11 @@ fun testUnresolved() { else -> a } - for (j in collection) { + for (j in collection) { var i: Int = j i += 1 foo1(j) - } + } } fun foo1(i: Int) {} diff --git a/idea/testData/checker/infos/SmartCasts.fir.kt b/idea/testData/checker/infos/SmartCasts.fir.kt index 4aae9cdb2dd..91c16c332fe 100644 --- a/idea/testData/checker/infos/SmartCasts.fir.kt +++ b/idea/testData/checker/infos/SmartCasts.fir.kt @@ -103,7 +103,7 @@ fun f13(a : A?) { } else { a?.foo() - c.bar() + c.bar() } a?.foo()