diff --git a/compiler/fir/analysis-tests/testData/resolve/arguments/ambiguityOnJavaOverride.kt b/compiler/fir/analysis-tests/testData/resolve/arguments/ambiguityOnJavaOverride.kt index 616ba08d947..ac36f03e9f6 100644 --- a/compiler/fir/analysis-tests/testData/resolve/arguments/ambiguityOnJavaOverride.kt +++ b/compiler/fir/analysis-tests/testData/resolve/arguments/ambiguityOnJavaOverride.kt @@ -15,5 +15,5 @@ class B : A() { } fun test(b: B) { - b.foo("") + b.foo("") } diff --git a/compiler/fir/analysis-tests/testData/resolve/arguments/default.kt b/compiler/fir/analysis-tests/testData/resolve/arguments/default.kt index d9ac68a53ae..bf5a1904af2 100644 --- a/compiler/fir/analysis-tests/testData/resolve/arguments/default.kt +++ b/compiler/fir/analysis-tests/testData/resolve/arguments/default.kt @@ -8,19 +8,19 @@ fun test() { foo(1, 2.0, true) foo(1, third = true) - foo() - foo(0, 0.0, false, "") + foo() + foo(0, 0.0, false, "") bar(1, third = true) bar(1, 2.0, true) bar(1, 2.0, true, "my") - bar(1, true) + bar(1, true) baz(1) baz(1, "my", "yours") baz(1, z = true) - baz(0, "", false) + baz(0, "", false) } diff --git a/compiler/fir/analysis-tests/testData/resolve/arguments/defaultFromOverrides.kt b/compiler/fir/analysis-tests/testData/resolve/arguments/defaultFromOverrides.kt index af4ff520d6b..6995c3c4d61 100644 --- a/compiler/fir/analysis-tests/testData/resolve/arguments/defaultFromOverrides.kt +++ b/compiler/fir/analysis-tests/testData/resolve/arguments/defaultFromOverrides.kt @@ -15,8 +15,8 @@ fun foo(a: A) { a.foo() a.foo(1) - a.bar() - a.bar("") + a.bar() + a.bar("") a.bar(y = 1) a.bar("", 2) } diff --git a/compiler/fir/analysis-tests/testData/resolve/arguments/integerLiteralTypes.kt b/compiler/fir/analysis-tests/testData/resolve/arguments/integerLiteralTypes.kt index 59b75b27414..0aa726d7740 100644 --- a/compiler/fir/analysis-tests/testData/resolve/arguments/integerLiteralTypes.kt +++ b/compiler/fir/analysis-tests/testData/resolve/arguments/integerLiteralTypes.kt @@ -17,9 +17,9 @@ fun test_1() { } fun test_2() { - takeInt(10000000000) + takeInt(10000000000) takeLong(10000000000) - takeByte(1000) + takeByte(1000) } fun test_3() { @@ -35,8 +35,8 @@ fun test_4() { } fun test_5() { - takeString(1) - takeString(run { 1 }) + takeString(1) + takeString(run { 1 }) } annotation class Ann(val x: Byte) diff --git a/compiler/fir/analysis-tests/testData/resolve/arguments/javaArrayVariance.kt b/compiler/fir/analysis-tests/testData/resolve/arguments/javaArrayVariance.kt index b6916223877..5972c59efdb 100644 --- a/compiler/fir/analysis-tests/testData/resolve/arguments/javaArrayVariance.kt +++ b/compiler/fir/analysis-tests/testData/resolve/arguments/javaArrayVariance.kt @@ -13,6 +13,6 @@ fun takeOutA(array: Array) {} fun test(array: Array) { A.take(array) - takeA(array) + takeA(array) takeOutA(array) } diff --git a/compiler/fir/analysis-tests/testData/resolve/arguments/lambda.kt b/compiler/fir/analysis-tests/testData/resolve/arguments/lambda.kt index 99f98ae6f6c..efbfd0fe827 100644 --- a/compiler/fir/analysis-tests/testData/resolve/arguments/lambda.kt +++ b/compiler/fir/analysis-tests/testData/resolve/arguments/lambda.kt @@ -10,8 +10,8 @@ fun test() { foo({}) // Bad - foo(1) {} - foo(f = {}) {} + foo(1) {} + foo(f = {}) {} // OK bar(1) {} @@ -20,15 +20,15 @@ fun test() { bar(x = 1, f = {}) // Bad - bar {} - bar({}) + bar {} + bar({}) // OK baz(other = false, f = {}) baz({}, false) // Bad - baz {} - baz() {} - baz(other = false) {} + baz {} + baz() {} + baz(other = false) {} } diff --git a/compiler/fir/analysis-tests/testData/resolve/arguments/lambdaInUnresolvedCall.kt b/compiler/fir/analysis-tests/testData/resolve/arguments/lambdaInUnresolvedCall.kt index f867a56997e..99ee3e6cfa0 100644 --- a/compiler/fir/analysis-tests/testData/resolve/arguments/lambdaInUnresolvedCall.kt +++ b/compiler/fir/analysis-tests/testData/resolve/arguments/lambdaInUnresolvedCall.kt @@ -1,14 +1,14 @@ fun materialize(): R = null!! fun test_1() { - myRun { + myRun { val x = 1 x * 2 - } + } } fun test_2() { - myRun { + myRun { materialize() - } + } } diff --git a/compiler/fir/analysis-tests/testData/resolve/arguments/operatorsOverLiterals.kt b/compiler/fir/analysis-tests/testData/resolve/arguments/operatorsOverLiterals.kt index 445ecf3ff4d..242b333b0a0 100644 --- a/compiler/fir/analysis-tests/testData/resolve/arguments/operatorsOverLiterals.kt +++ b/compiler/fir/analysis-tests/testData/resolve/arguments/operatorsOverLiterals.kt @@ -31,33 +31,33 @@ fun test_3() { fun takeByte(b: Byte) {} fun test_4() { - takeByte(1 + 1) - takeByte(1 + 127) - takeByte(1 - 1) - takeByte(-100 - 100) - takeByte(10 * 10) - takeByte(100 * 100) - taleByte(10 / 10) - takeByte(100 % 10) - takeByte(1000 % 10) - takeByte(1000 and 100) - takeByte(128 and 511) - takeByte(100 or 100) - takeByte(1000 or 0) - takeByte(511 xor 511) - takeByte(512 xor 511) + takeByte(1 + 1) + takeByte(1 + 127) + takeByte(1 - 1) + takeByte(-100 - 100) + takeByte(10 * 10) + takeByte(100 * 100) + taleByte(10 / 10) + takeByte(100 % 10) + takeByte(1000 % 10) + takeByte(1000 and 100) + takeByte(128 and 511) + takeByte(100 or 100) + takeByte(1000 or 0) + takeByte(511 xor 511) + takeByte(512 xor 511) } fun test_5() { takeByte(-1) takeByte(+1) - takeByte(1.inv()) + takeByte(1.inv()) } fun test_6() { - takeByte(run { 127 + 1 }) - takeByte(1 + run { 1 }) - takeByte(run { 1 + 1 }) + takeByte(run { 127 + 1 }) + takeByte(1 + run { 1 }) + takeByte(run { 1 + 1 }) 1 + 1 run { 1 } 1 + run { 1 } diff --git a/compiler/fir/analysis-tests/testData/resolve/arguments/simple.kt b/compiler/fir/analysis-tests/testData/resolve/arguments/simple.kt index d669fd5ef8a..737e67d3b8e 100644 --- a/compiler/fir/analysis-tests/testData/resolve/arguments/simple.kt +++ b/compiler/fir/analysis-tests/testData/resolve/arguments/simple.kt @@ -7,11 +7,11 @@ fun test() { foo(1, second = 3.14, third = false, fourth = "!?") foo(third = false, second = 2.71, fourth = "?!", first = 0) - foo() - foo(0.0, false, 0, "") + foo() + foo(0.0, false, 0, "") foo(1, 2.0, third = true, "") - foo(second = 0.0, first = 0, fourth = "") - foo(first = 0.0, second = 0, third = "", fourth = false) - foo(first = 0, second = 0.0, third = false, fourth = "", first = 1) - foo(0, 0.0, false, foth = "") + foo(second = 0.0, first = 0, fourth = "") + foo(first = 0.0, second = 0, third = "", fourth = false) + foo(first = 0, second = 0.0, third = false, fourth = "", first = 1) + foo(0, 0.0, false, foth = "") } diff --git a/compiler/fir/analysis-tests/testData/resolve/arguments/vararg.kt b/compiler/fir/analysis-tests/testData/resolve/arguments/vararg.kt index ecafa19ebb0..f42aee5067d 100644 --- a/compiler/fir/analysis-tests/testData/resolve/arguments/vararg.kt +++ b/compiler/fir/analysis-tests/testData/resolve/arguments/vararg.kt @@ -7,11 +7,11 @@ fun test() { foo(1, "my", "yours") foo(1, *arrayOf("my", "yours")) - foo("") - foo(1, 2) + foo("") + foo(1, 2) bar(1, z = true, y = *arrayOf("my", "yours")) - bar(0, z = false, y = "", y = "other") - bar(0, "", true) + bar(0, z = false, y = "", y = "other") + bar(0, "", true) } diff --git a/compiler/fir/analysis-tests/testData/resolve/asImports.kt b/compiler/fir/analysis-tests/testData/resolve/asImports.kt index 33826641a61..8847a4c7fc4 100644 --- a/compiler/fir/analysis-tests/testData/resolve/asImports.kt +++ b/compiler/fir/analysis-tests/testData/resolve/asImports.kt @@ -11,9 +11,9 @@ class A { import foo.A as B fun test_1() { - val a = A() + val a = A() val b = B() // should be OK - val c: B = A() + val c: B = A() } fun test_2(b: B) { diff --git a/compiler/fir/analysis-tests/testData/resolve/callResolution/errorCandidates.kt b/compiler/fir/analysis-tests/testData/resolve/callResolution/errorCandidates.kt index 8ce85a18c6e..390901c0302 100644 --- a/compiler/fir/analysis-tests/testData/resolve/callResolution/errorCandidates.kt +++ b/compiler/fir/analysis-tests/testData/resolve/callResolution/errorCandidates.kt @@ -9,11 +9,11 @@ fun bar(x: B) {} fun test(c: C) { // Argument mapping error - foo("") + foo("") // Ambiguity - bar(c) + bar(c) // Unresolved reference - baz() + baz() } diff --git a/compiler/fir/analysis-tests/testData/resolve/callResolution/lambdaAsReceiver.kt b/compiler/fir/analysis-tests/testData/resolve/callResolution/lambdaAsReceiver.kt index c6cc6917af0..543f908a55b 100644 --- a/compiler/fir/analysis-tests/testData/resolve/callResolution/lambdaAsReceiver.kt +++ b/compiler/fir/analysis-tests/testData/resolve/callResolution/lambdaAsReceiver.kt @@ -9,6 +9,6 @@ fun main1() { } fun main2() { - { "" }.bar() + { "" }.bar() "".bar() } diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda.kt b/compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda.kt index be90f5a38d6..f91d92380d2 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda.kt +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda.kt @@ -19,7 +19,7 @@ fun test_2(x: Any, y: Any) { val a = select( id( run { - y.inc() // Bad + y.inc() // Bad x as Int } ), @@ -39,14 +39,14 @@ fun test_3(x: Any, y: Any) { val a = select( id( run { - y.inc() // Bad + y.inc() // Bad x as Int materialize() } ), run { y as Int - x.inc() // Bad + x.inc() // Bad y.inc() // OK 1 } @@ -60,19 +60,19 @@ fun test_4(x: Any, y: Any) { val a = select( id( myRun { - y.inc() // Bad + y.inc() // Bad x as Int } ), y as Int, myRun { - x.inc() // Bad + x.inc() // Bad y.inc() // OK 1 } ) - takeInt(x) // Bad + takeInt(x) // Bad takeInt(y) // OK takeInt(a) // Bad } diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/abstractSuperCall.kt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/abstractSuperCall.kt index 18abcc097c6..4c7e16469db 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/abstractSuperCall.kt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/abstractSuperCall.kt @@ -22,7 +22,7 @@ class B : A() { } fun g() { - super.f() + super.f() super.t() super.x @@ -32,7 +32,7 @@ class B : A() { abstract class J : A() { fun r() { - super.f() + super.f() super.t() super.x diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/abstractSuperCallInPresenseOfNonAbstractMethodInParent.kt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/abstractSuperCallInPresenseOfNonAbstractMethodInParent.kt index 9ad38609849..23e7fc1dfcb 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/abstractSuperCallInPresenseOfNonAbstractMethodInParent.kt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/abstractSuperCallInPresenseOfNonAbstractMethodInParent.kt @@ -13,5 +13,5 @@ open class B { class A : IWithToString, B() { override fun toString(): String = super.toString() // resolve to Any.toString override fun foo(): String = super.foo() // resolve to B.foo() - override fun bar(): String = super.bar() // should be an error + override fun bar(): String = super.bar() // should be an error } diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/cyclicConstructorDelegationCall.kt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/cyclicConstructorDelegationCall.kt index 3e0bcb593bf..120b6037dca 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/cyclicConstructorDelegationCall.kt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/cyclicConstructorDelegationCall.kt @@ -63,5 +63,5 @@ class M { } class U : M { - constructor() + constructor() } diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/explicitDelegationCallRequired.kt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/explicitDelegationCallRequired.kt index 89391c3f554..2aa050d6cd7 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/explicitDelegationCallRequired.kt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/explicitDelegationCallRequired.kt @@ -3,16 +3,16 @@ class A(x: Int) { } class B : A { - constructor() + constructor() constructor(z: String) : this() } class C : A(20) { - constructor() + constructor() constructor(z: String) : this() } class D() : A(20) { - constructor(x: Int) + constructor(x: Int) constructor(z: String) : this() } diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/instanceAccessBeforeSuperCall.kt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/instanceAccessBeforeSuperCall.kt index ecc452d60ca..bd69a862cac 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/instanceAccessBeforeSuperCall.kt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/instanceAccessBeforeSuperCall.kt @@ -1,5 +1,5 @@ class A { - constructor(x: Int = getSomeInt(), other: A = this, header: String = keker) {} + constructor(x: Int = getSomeInt(), other: A = this, header: String = keker) {} fun getSomeInt() = 10 var keker = "test" } diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/notASupertype.kt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/notASupertype.kt index 4e8a13c2ee7..7d5354dc497 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/notASupertype.kt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/notASupertype.kt @@ -4,7 +4,7 @@ class A { class B : A { fun g() { - super.f() + super.f() super.f() } } diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/sealedClassConstructorCall.kt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/sealedClassConstructorCall.kt index f0f7d5dc473..c4717ff1394 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/sealedClassConstructorCall.kt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/sealedClassConstructorCall.kt @@ -1,3 +1,3 @@ sealed class A -val b = A() +val b = A() diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/superIsNotAnExpression.kt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/superIsNotAnExpression.kt index 22f7caf5bcd..f41d78a6551 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/superIsNotAnExpression.kt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/superIsNotAnExpression.kt @@ -4,7 +4,7 @@ class B: A() { fun act() { super() - invoke() + invoke() super { println('weird') diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/superNotAvailable.kt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/superNotAvailable.kt index 1ca40411257..62de59fefa9 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/superNotAvailable.kt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/superNotAvailable.kt @@ -1,20 +1,20 @@ fun String.f() { - super@f.compareTo("") - super.compareTo("") + super@f.compareTo("") + super.compareTo("") } fun foo() { super - super.foo() - super.foo() + super.foo() + super.foo() } class A { fun act() { - println("Test") + println("Test") } fun String.fact() { - println("Fest") + println("Fest") } } diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/typeArgumentsNotAllowed.kt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/typeArgumentsNotAllowed.kt index c01d19b07bc..796fdcbfc0d 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/typeArgumentsNotAllowed.kt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/typeArgumentsNotAllowed.kt @@ -17,8 +17,8 @@ object Best { } -val a = rest.MyClass -val b = Best.MyClass +val a = rest.MyClass +val b = Best.MyClass class B class C<Boolean>> : B<F<Boolean>>() diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/upperBoundViolated.kt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/upperBoundViolated.kt index 9e0ce9dcbfc..82d44bb7e8b 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/upperBoundViolated.kt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/upperBoundViolated.kt @@ -45,4 +45,4 @@ val test8 = NL() class NumberPhile(x: T) val np1 = NumberPhile(10) -val np2 = NumberPhile("Test") +val np2 = NumberPhile("Test") diff --git a/compiler/fir/analysis-tests/testData/resolve/exhaustiveness/positive/exhaustiveness_enumJava.kt b/compiler/fir/analysis-tests/testData/resolve/exhaustiveness/positive/exhaustiveness_enumJava.kt index 463216e5e5f..07ab6b5a49d 100644 --- a/compiler/fir/analysis-tests/testData/resolve/exhaustiveness/positive/exhaustiveness_enumJava.kt +++ b/compiler/fir/analysis-tests/testData/resolve/exhaustiveness/positive/exhaustiveness_enumJava.kt @@ -10,13 +10,13 @@ fun test_1(e: JavaEnum) { val a = when (e) { JavaEnum.A -> 1 JavaEnum.B -> 2 - }.plus(0) + }.plus(0) val b = when (e) { JavaEnum.A -> 1 JavaEnum.B -> 2 is String -> 3 - }.plus(0) + }.plus(0) val c = when (e) { JavaEnum.A -> 1 @@ -35,7 +35,7 @@ fun test_2(e: JavaEnum?) { JavaEnum.A -> 1 JavaEnum.B -> 2 JavaEnum.C -> 3 - }.plus(0) + }.plus(0) val a = when (e) { JavaEnum.A -> 1 diff --git a/compiler/fir/analysis-tests/testData/resolve/exhaustiveness/positive/exhaustiveness_sealedSubClass.kt b/compiler/fir/analysis-tests/testData/resolve/exhaustiveness/positive/exhaustiveness_sealedSubClass.kt index 9beeb8a7276..e7c9a2027b2 100644 --- a/compiler/fir/analysis-tests/testData/resolve/exhaustiveness/positive/exhaustiveness_sealedSubClass.kt +++ b/compiler/fir/analysis-tests/testData/resolve/exhaustiveness/positive/exhaustiveness_sealedSubClass.kt @@ -35,18 +35,18 @@ fun test_2(e: A) { val a = when (e) { is D -> 1 is E -> 2 - }.plus(0) + }.plus(0) val b = when (e) { is B -> 1 is D -> 2 is E -> 3 - }.plus(0) + }.plus(0) val c = when (e) { is B -> 1 is D -> 2 - }.plus(0) + }.plus(0) val d = when (e) { is C -> 1 diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/CallBasedInExpressionGenerator.kt b/compiler/fir/analysis-tests/testData/resolve/expresssions/CallBasedInExpressionGenerator.kt index 7fa0c9cc927..abb4cda0e57 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/CallBasedInExpressionGenerator.kt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/CallBasedInExpressionGenerator.kt @@ -14,27 +14,27 @@ class CallBasedInExpressionGenerator( val codegen: ExpressionCodegen, operatorReference: KtSimpleNameExpression ) : InExpressionGenerator { - private val resolvedCall = operatorReference.getResolvedCallWithAssert(codegen.bindingContext) - private val isInverted = operatorReference.getReferencedNameElementType() == KtTokens.NOT_IN + private val resolvedCall = operatorReference.getResolvedCallWithAssert(codegen.bindingContext) + private val isInverted = operatorReference.getReferencedNameElementType() == KtTokens.NOT_IN override fun generate(argument: StackValue): BranchedValue = - gen(argument).let { if (isInverted) Invert(it) else it } + gen(argument).let { if (isInverted) Invert(it) else it } private fun gen(argument: StackValue): BranchedValue = object : BranchedValue(argument, null, argument.type, Opcodes.IFEQ) { override fun putSelector(type: Type, kotlinType: KotlinType?, v: InstructionAdapter) { invokeFunction(v) - coerceTo(type, kotlinType, v) + coerceTo(type, kotlinType, v) } 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) { - val result = codegen.invokeFunction(resolvedCall.call, resolvedCall, none()) - result.put(result.type, result.kotlinType, v) + val result = codegen.invokeFunction(resolvedCall.call, resolvedCall, none()) + result.put(result.type, result.kotlinType, v) } } } diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/access.kt b/compiler/fir/analysis-tests/testData/resolve/expresssions/access.kt index 88236e7ebc8..ead6b21eda9 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/access.kt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/access.kt @@ -43,7 +43,7 @@ fun f() { val d = "" val c = c - abc() + abc() fun bcd() {} @@ -57,7 +57,7 @@ fun f() { dcb() } - dcb() + dcb() abc() } diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/baseQualifier.kt b/compiler/fir/analysis-tests/testData/resolve/expresssions/baseQualifier.kt index cbc2599b9f9..8df28862e89 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/baseQualifier.kt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/baseQualifier.kt @@ -20,6 +20,6 @@ fun test() { JavaClass.bar() val errC = BB.C - val errBarViaBB = BB.bar() - val errBarViaAA = AA.bar() + val errBarViaBB = BB.bar() + val errBarViaAA = AA.bar() } diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/enumEntryUse.kt b/compiler/fir/analysis-tests/testData/resolve/expresssions/enumEntryUse.kt index e20e2c8f8e4..a9d5bb7a440 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/enumEntryUse.kt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/enumEntryUse.kt @@ -18,5 +18,5 @@ fun test() { useEnum(TestEnum.THIRD) useVararg(TestEnum.FIRST, TestEnum.SECOND) - useVararg(1, 2, 3, 4, 5) + useVararg(1, 2, 3, 4, 5) } diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/inference/typeParameters.kt b/compiler/fir/analysis-tests/testData/resolve/expresssions/inference/typeParameters.kt index ad6516e7254..651ca4c1e6f 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/inference/typeParameters.kt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/inference/typeParameters.kt @@ -7,5 +7,5 @@ fun foo(t: T) = t fun main(fooImpl: FooImpl, bar: Bar) { val a = foo(fooImpl) - val b = foo(bar) + val b = foo(bar) } diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/inference/typeParameters2.kt b/compiler/fir/analysis-tests/testData/resolve/expresssions/inference/typeParameters2.kt index a44c5a04324..f4bf4ac52f5 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/inference/typeParameters2.kt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/inference/typeParameters2.kt @@ -6,6 +6,6 @@ fun foo(t: T) = t fun main(fooImpl: FooImpl, fooBarImpl: FooBarImpl) { - val a = foo(fooBarImpl) + val a = foo(fooBarImpl) val b = foo(fooImpl) } diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/threeReceivers.kt b/compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/threeReceivers.kt index 50171203e9a..e5081adbb98 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/threeReceivers.kt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/threeReceivers.kt @@ -17,6 +17,6 @@ class Foo { // this@Foo is dispatch receiver of foobar // Foo/foobar is dispatch receiver of invoke // this@chk is extension receiver of invoke - buz.foobar() + buz.foobar() } } diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/localObjects.kt b/compiler/fir/analysis-tests/testData/resolve/expresssions/localObjects.kt index cf10589374f..a90af6e1282 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/nestedVisibility.kt b/compiler/fir/analysis-tests/testData/resolve/expresssions/nestedVisibility.kt index 960d7239e02..73ed9de9800 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/nestedVisibility.kt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/nestedVisibility.kt @@ -11,8 +11,8 @@ open class Outer { class Derived : Outer() { fun foo() { - Outer.PrivateNested() - super.PrivateInner() + Outer.PrivateNested() + super.PrivateInner() Outer.ProtectedNested() super.ProtectedInner() @@ -23,11 +23,11 @@ class Derived : Outer() { } fun foo() { - Outer.PrivateNested() - Outer().PrivateInner() + Outer.PrivateNested() + Outer().PrivateInner() - Outer.ProtectedNested() - Outer().ProtectedInner() + Outer.ProtectedNested() + Outer().ProtectedInner() Outer.PublicNested() Outer().PublicInner() diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/privateVisibility.kt b/compiler/fir/analysis-tests/testData/resolve/expresssions/privateVisibility.kt index f1426b42391..c61aef1fbcf 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/privateVisibility.kt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/privateVisibility.kt @@ -9,21 +9,21 @@ private class Private { bar() Nested() fromCompanion() - NotCompanion.foo() // hidden + NotCompanion.foo() // hidden } inner class Inner { fun foo() { bar() fromCompanion() - NotCompanion.foo() // hidden + NotCompanion.foo() // hidden } } private class Nested { fun foo() { fromCompanion() - NotCompanion.foo() // hidden + NotCompanion.foo() // hidden } } @@ -54,7 +54,7 @@ fun withLocals() { Local().baz() - Local().bar() // hidden + Local().bar() // hidden } fun test() { @@ -62,14 +62,14 @@ fun test() { Private().baz() Private().Inner() - Private().bar() // hidden - Private.Nested() // hidden - Private.fromCompanion() // hidden + Private().bar() // hidden + Private.Nested() // hidden + Private.fromCompanion() // hidden } // FILE: second.kt fun secondTest() { - foo() // hidden - Private() // hidden + foo() // hidden + Private() // hidden } diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/protectedVisibility.kt b/compiler/fir/analysis-tests/testData/resolve/expresssions/protectedVisibility.kt index 537f0fd2009..f27cce779d2 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/protectedVisibility.kt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/protectedVisibility.kt @@ -31,7 +31,7 @@ class Derived : Protected() { fun foo() { bar() Nested().foo() - Nested().bar() // hidden + Nested().bar() // hidden fromCompanion() protectedFromCompanion() @@ -48,8 +48,8 @@ fun test() { Protected().baz() Protected().Inner() - Protected().bar() // hidden - Protected.Nested() // hidden + Protected().bar() // hidden + Protected.Nested() // hidden } open class Generic(val x: T) { diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/receiverConsistency.kt b/compiler/fir/analysis-tests/testData/resolve/expresssions/receiverConsistency.kt index 86ab1c8ab94..e95a3e3bf6a 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/receiverConsistency.kt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/receiverConsistency.kt @@ -6,7 +6,7 @@ class C { class Nested { fun test() { - err() + err() } } } @@ -17,5 +17,5 @@ fun test() { c.bar() val err = C() - err.foo() + err.foo() } diff --git a/compiler/fir/analysis-tests/testData/resolve/fromBuilder/enums.kt b/compiler/fir/analysis-tests/testData/resolve/fromBuilder/enums.kt index 0e6ac864eb4..b651fd02343 100644 --- a/compiler/fir/analysis-tests/testData/resolve/fromBuilder/enums.kt +++ b/compiler/fir/analysis-tests/testData/resolve/fromBuilder/enums.kt @@ -9,17 +9,17 @@ enum class Order { enum class Planet(val m: Double, internal val r: Double) { MERCURY(1.0, 2.0) { override fun sayHello() { - println("Hello!!!") + println("Hello!!!") } }, VENERA(3.0, 4.0) { override fun sayHello() { - println("Ola!!!") + println("Ola!!!") } }, EARTH(5.0, 6.0) { override fun sayHello() { - println("Privet!!!") + println("Privet!!!") } }; diff --git a/compiler/fir/analysis-tests/testData/resolve/incorrectSuperCall.kt b/compiler/fir/analysis-tests/testData/resolve/incorrectSuperCall.kt index 50c694c5335..923a96486fc 100644 --- a/compiler/fir/analysis-tests/testData/resolve/incorrectSuperCall.kt +++ b/compiler/fir/analysis-tests/testData/resolve/incorrectSuperCall.kt @@ -15,7 +15,7 @@ class C : A, B() { override fun foo() { super.foo() - super.bar() // should be ambiguity (NB: really we should have overridden bar in C) + super.bar() // should be ambiguity (NB: really we should have overridden bar in C) super.baz() // Ok baz() // Ok diff --git a/compiler/fir/analysis-tests/testData/resolve/inference/nullableIntegerLiteralType.kt b/compiler/fir/analysis-tests/testData/resolve/inference/nullableIntegerLiteralType.kt index 51b826f6b5a..14fcd4dd0ff 100644 --- a/compiler/fir/analysis-tests/testData/resolve/inference/nullableIntegerLiteralType.kt +++ b/compiler/fir/analysis-tests/testData/resolve/inference/nullableIntegerLiteralType.kt @@ -4,10 +4,10 @@ fun takeInt(x: Int) {} fun test_1(b: Boolean) { val x = if (b) 1 else null - takeInt(x) + takeInt(x) } fun test_2(b: Boolean, y: Int) { val x = if (b) y else null - takeInt(x) + takeInt(x) } diff --git a/compiler/fir/analysis-tests/testData/resolve/inference/receiverWithCapturedType.kt b/compiler/fir/analysis-tests/testData/resolve/inference/receiverWithCapturedType.kt index 281eb062606..0a52fd88247 100644 --- a/compiler/fir/analysis-tests/testData/resolve/inference/receiverWithCapturedType.kt +++ b/compiler/fir/analysis-tests/testData/resolve/inference/receiverWithCapturedType.kt @@ -24,7 +24,7 @@ fun test_1_3(resolvedCall: ResolvedCall) { } fun test_2_1(resolvedCall: ResolvedCall, d: CallableDescriptor) { - val x = resolvedCall.updateD(d) // should fail + val x = resolvedCall.updateD(d) // should fail } fun test_2_2(resolvedCall: ResolvedCall, d: CallableDescriptor) { diff --git a/compiler/fir/analysis-tests/testData/resolve/innerClasses/inner.kt b/compiler/fir/analysis-tests/testData/resolve/innerClasses/inner.kt index 1c6aaf68ba1..d6758a13e51 100644 --- a/compiler/fir/analysis-tests/testData/resolve/innerClasses/inner.kt +++ b/compiler/fir/analysis-tests/testData/resolve/innerClasses/inner.kt @@ -23,7 +23,7 @@ class Owner { o.foo() foo() this@Owner.foo() - this.err() + this.err() } } } @@ -31,8 +31,8 @@ class Owner { fun test() { val o = Owner() o.foo() - val err = Owner.Inner() - err.baz() + val err = Owner.Inner() + err.baz() val i = o.Inner() i.gau() } diff --git a/compiler/fir/analysis-tests/testData/resolve/innerClasses/innerTypes.kt b/compiler/fir/analysis-tests/testData/resolve/innerClasses/innerTypes.kt index 8c866732348..6e298256607 100644 --- a/compiler/fir/analysis-tests/testData/resolve/innerClasses/innerTypes.kt +++ b/compiler/fir/analysis-tests/testData/resolve/innerClasses/innerTypes.kt @@ -12,10 +12,10 @@ val rr = Outer().Inner() val rrq = Boxed().substitute() fun check() { - accept(Outer().Inner()) // illegal - accept(Outer().Inner()) // illegal + accept(Outer().Inner()) // illegal + accept(Outer().Inner()) // illegal accept(Outer().Inner()) // ok - accept(Boxed().substitute()) // illegal + accept(Boxed().substitute()) // illegal accept(Boxed().substitute()) // ok } diff --git a/compiler/fir/analysis-tests/testData/resolve/innerClasses/simple.kt b/compiler/fir/analysis-tests/testData/resolve/innerClasses/simple.kt index 0046ca0b2b2..d10a2c4c0f0 100644 --- a/compiler/fir/analysis-tests/testData/resolve/innerClasses/simple.kt +++ b/compiler/fir/analysis-tests/testData/resolve/innerClasses/simple.kt @@ -22,8 +22,8 @@ class Owner { } fun err() { - foo() - this.foo() + foo() + this.foo() } } } diff --git a/compiler/fir/analysis-tests/testData/resolve/kt41984.kt b/compiler/fir/analysis-tests/testData/resolve/kt41984.kt index 41180d7f030..e693f6acce1 100644 --- a/compiler/fir/analysis-tests/testData/resolve/kt41984.kt +++ b/compiler/fir/analysis-tests/testData/resolve/kt41984.kt @@ -26,6 +26,6 @@ open class B : A() { fun test_1(b: B, x: Int, inv: Inv) { b.take(x) - b.take(null) + b.take(null) b.takeInv(inv) } diff --git a/compiler/fir/analysis-tests/testData/resolve/lambdaArgInScopeFunction.kt b/compiler/fir/analysis-tests/testData/resolve/lambdaArgInScopeFunction.kt index 6cbf919f1ec..16b0ad25478 100644 --- a/compiler/fir/analysis-tests/testData/resolve/lambdaArgInScopeFunction.kt +++ b/compiler/fir/analysis-tests/testData/resolve/lambdaArgInScopeFunction.kt @@ -21,7 +21,7 @@ fun case1(kotlinClass: KotlinClass?) { {it} } - lambda.checkType { _>() } + lambda.checkType { _>() } } // TESTCASE NUMBER: 2 fun case2(kotlinClass: KotlinClass) { @@ -36,5 +36,5 @@ fun case2(kotlinClass: KotlinClass) { {it} } - lambda.checkType { _>() } + lambda.checkType { _>() } } diff --git a/compiler/fir/analysis-tests/testData/resolve/lambdaPropertyTypeInference.kt b/compiler/fir/analysis-tests/testData/resolve/lambdaPropertyTypeInference.kt index 03ce460d5d4..8bae96c5e36 100644 --- a/compiler/fir/analysis-tests/testData/resolve/lambdaPropertyTypeInference.kt +++ b/compiler/fir/analysis-tests/testData/resolve/lambdaPropertyTypeInference.kt @@ -26,9 +26,9 @@ fun case1(javaClass: JavaClass?) { validType.checkType { _>() } //ok - invalidType.checkType { _>() } //(!!!) + invalidType.checkType { _>() } //(!!!) - Case1(javaClass).x.checkType { _>() } //(!!!) + Case1(javaClass).x.checkType { _>() } //(!!!) } class Case1(val javaClass: JavaClass?) { @@ -55,9 +55,9 @@ fun case2(kotlinClass: KotlinClass?) { validType.checkType { _>() } //ok - invalidType.checkType { _>() } //(!!!) + invalidType.checkType { _>() } //(!!!) - Case2(kotlinClass).x.checkType { _>() } //(!!!) + Case2(kotlinClass).x.checkType { _>() } //(!!!) } class Case2(val kotlinClass: KotlinClass?) { diff --git a/compiler/fir/analysis-tests/testData/resolve/nestedClassContructor.kt b/compiler/fir/analysis-tests/testData/resolve/nestedClassContructor.kt index 0f5bdbfd63e..076512e710a 100644 --- a/compiler/fir/analysis-tests/testData/resolve/nestedClassContructor.kt +++ b/compiler/fir/analysis-tests/testData/resolve/nestedClassContructor.kt @@ -17,7 +17,7 @@ class D : A.C() { val a = A() val ac = A.C() - val c = C() // shouldn't resolve + val c = C() // shouldn't resolve } } diff --git a/compiler/fir/analysis-tests/testData/resolve/overrides/simple.kt b/compiler/fir/analysis-tests/testData/resolve/overrides/simple.kt index a956ba7e5e9..f87bf8fb820 100644 --- a/compiler/fir/analysis-tests/testData/resolve/overrides/simple.kt +++ b/compiler/fir/analysis-tests/testData/resolve/overrides/simple.kt @@ -14,7 +14,7 @@ class B : A() { fun test() { foo() bar() - buz() + buz() } } diff --git a/compiler/fir/analysis-tests/testData/resolve/overrides/supertypeGenericsComplex.kt b/compiler/fir/analysis-tests/testData/resolve/overrides/supertypeGenericsComplex.kt index b7e5ab8f445..5fd73df0428 100644 --- a/compiler/fir/analysis-tests/testData/resolve/overrides/supertypeGenericsComplex.kt +++ b/compiler/fir/analysis-tests/testData/resolve/overrides/supertypeGenericsComplex.kt @@ -10,5 +10,5 @@ class C : Base() fun f(list: MutableList, s: MutableList) { C().f(list, s) - C().f(s, list) + C().f(s, list) } diff --git a/compiler/fir/analysis-tests/testData/resolve/problems/definitelyNotNullAndOriginalType.kt b/compiler/fir/analysis-tests/testData/resolve/problems/definitelyNotNullAndOriginalType.kt index 384164d4d76..0230fdf919f 100644 --- a/compiler/fir/analysis-tests/testData/resolve/problems/definitelyNotNullAndOriginalType.kt +++ b/compiler/fir/analysis-tests/testData/resolve/problems/definitelyNotNullAndOriginalType.kt @@ -11,5 +11,5 @@ public interface SLRUMap { // FILE: main.kt fun SLRUMap.getOrPut(value: V) { - takeV(value) + takeV(value) } diff --git a/compiler/fir/analysis-tests/testData/resolve/problems/inaccessibleJavaGetter.kt b/compiler/fir/analysis-tests/testData/resolve/problems/inaccessibleJavaGetter.kt index c7645a90525..44ef3776643 100644 --- a/compiler/fir/analysis-tests/testData/resolve/problems/inaccessibleJavaGetter.kt +++ b/compiler/fir/analysis-tests/testData/resolve/problems/inaccessibleJavaGetter.kt @@ -20,7 +20,7 @@ class WrappedPropertyDescriptor : PropertyDescriptor { fun test() { val descriptor = WrappedPropertyDescriptor() val res1 = descriptor.setter - val res2 = descriptor.getSetter() // Should be error + val res2 = descriptor.getSetter() // Should be error val res3 = descriptor.isDelegated - val res4 = descriptor.isDelegated() // Should be error + val res4 = descriptor.isDelegated() // Should be error } diff --git a/compiler/fir/analysis-tests/testData/resolve/problems/multipleJavaClassesInOneFile.kt b/compiler/fir/analysis-tests/testData/resolve/problems/multipleJavaClassesInOneFile.kt index 704db700550..1ba85216a6c 100644 --- a/compiler/fir/analysis-tests/testData/resolve/problems/multipleJavaClassesInOneFile.kt +++ b/compiler/fir/analysis-tests/testData/resolve/problems/multipleJavaClassesInOneFile.kt @@ -10,5 +10,5 @@ class Another {} fun test() { val some = Some() - val another = Another() + val another = Another() } diff --git a/compiler/fir/analysis-tests/testData/resolve/properties/syntheticPropertiesForJavaAnnotations.kt b/compiler/fir/analysis-tests/testData/resolve/properties/syntheticPropertiesForJavaAnnotations.kt index 0c98ff8eb99..30c39006a34 100644 --- a/compiler/fir/analysis-tests/testData/resolve/properties/syntheticPropertiesForJavaAnnotations.kt +++ b/compiler/fir/analysis-tests/testData/resolve/properties/syntheticPropertiesForJavaAnnotations.kt @@ -10,5 +10,5 @@ public @interface Ann { fun test(ann: Ann) { ann.value - ann.value() // should be an error + ann.value() // should be an error } diff --git a/compiler/fir/analysis-tests/testData/resolve/samConstructors/genericSamInferenceFromExpectType.kt b/compiler/fir/analysis-tests/testData/resolve/samConstructors/genericSamInferenceFromExpectType.kt index 2316e66886c..dda848e2b85 100644 --- a/compiler/fir/analysis-tests/testData/resolve/samConstructors/genericSamInferenceFromExpectType.kt +++ b/compiler/fir/analysis-tests/testData/resolve/samConstructors/genericSamInferenceFromExpectType.kt @@ -18,9 +18,9 @@ fun main() { x.toInt().toString() }) - foo2(MyFunction { x: Int -> + foo2(MyFunction { x: Int -> x.toString() - }) + }) foo3( MyFunction { x -> diff --git a/compiler/fir/analysis-tests/testData/resolve/samConstructors/realConstructorFunction.kt b/compiler/fir/analysis-tests/testData/resolve/samConstructors/realConstructorFunction.kt index b3fa3fb01dc..d2426e224ed 100644 --- a/compiler/fir/analysis-tests/testData/resolve/samConstructors/realConstructorFunction.kt +++ b/compiler/fir/analysis-tests/testData/resolve/samConstructors/realConstructorFunction.kt @@ -10,13 +10,13 @@ fun foo(m: MyRunnable) {} fun MyRunnable(x: (Int) -> Boolean) = 1 fun main() { - foo(MyRunnable { x -> + foo(MyRunnable { x -> x > 1 - }) + }) - foo(MyRunnable({ it > 1 })) + foo(MyRunnable({ it > 1 })) val x = { x: Int -> x > 1 } - foo(MyRunnable(x)) + foo(MyRunnable(x)) } diff --git a/compiler/fir/analysis-tests/testData/resolve/samConversions/genericSam.kt b/compiler/fir/analysis-tests/testData/resolve/samConversions/genericSam.kt index 78977c1f58b..c4eac6be67d 100644 --- a/compiler/fir/analysis-tests/testData/resolve/samConversions/genericSam.kt +++ b/compiler/fir/analysis-tests/testData/resolve/samConversions/genericSam.kt @@ -21,9 +21,9 @@ fun main() { x.toInt().toString() } - JavaUsage.foo2 { x: Int -> + JavaUsage.foo2 { x: Int -> x.toString() - } + } JavaUsage.foo3( { x -> diff --git a/compiler/fir/analysis-tests/testData/resolve/samConversions/kotlinSam.kt b/compiler/fir/analysis-tests/testData/resolve/samConversions/kotlinSam.kt index cca6f7e9917..5fb027ccb83 100644 --- a/compiler/fir/analysis-tests/testData/resolve/samConversions/kotlinSam.kt +++ b/compiler/fir/analysis-tests/testData/resolve/samConversions/kotlinSam.kt @@ -29,11 +29,11 @@ fun main() { foo1 { x -> x > 1 } foo1(f) - foo2 { x -> x > 1 } - foo2(f) + foo2 { x -> x > 1 } + foo2(f) - foo3 { x -> x > 1 } - foo3(f) + foo3 { x -> x > 1 } + foo3(f) foo4 { x -> x > 1 } foo4(f) diff --git a/compiler/fir/analysis-tests/testData/resolve/samConversions/notSamBecauseOfSupertype.kt b/compiler/fir/analysis-tests/testData/resolve/samConversions/notSamBecauseOfSupertype.kt index da5d1c5b163..016843b8718 100644 --- a/compiler/fir/analysis-tests/testData/resolve/samConversions/notSamBecauseOfSupertype.kt +++ b/compiler/fir/analysis-tests/testData/resolve/samConversions/notSamBecauseOfSupertype.kt @@ -18,14 +18,14 @@ public class JavaUsage { fun foo(m: MyRunnable) {} fun main() { - JavaUsage.foo { + JavaUsage.foo { x -> x > 1 - } + } - JavaUsage.foo({ it > 1 }) + JavaUsage.foo({ it > 1 }) val x = { x: Int -> x > 1 } - JavaUsage.foo(x) + JavaUsage.foo(x) } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/booleanOperators.kt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/booleanOperators.kt index e45272656a6..4f293d49cd0 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/booleanOperators.kt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/booleanOperators.kt @@ -24,8 +24,8 @@ fun test_1(x: Any) { fun test_2(x: Any) { if (x is B || x is C) { x.foo() - x.bar() - x.baz() + x.bar() + x.baz() } } @@ -59,26 +59,26 @@ fun test_6(x: Any) { fun test_7(x: Any) { if (x is A || false) { // TODO: should be smartcast - x.foo() + x.foo() } } fun test_8(x: Any) { if (false || x is A) { // TODO: should be smartcast - x.foo() + x.foo() } } fun test_9(x: Any) { if (x is A || true) { - x.foo() + x.foo() } } fun test_10(x: Any) { if (true || x is A) { - x.foo() + x.foo() } } @@ -86,7 +86,7 @@ fun test_10(x: Any) { fun test_11(x: Any, b: Boolean) { if (false && x is A) { - x.foo() + x.foo() } } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcasts.kt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcasts.kt index f6e34990a98..e7be4c1de50 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcasts.kt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcasts.kt @@ -30,7 +30,7 @@ fun test_3(x: Any, y: Any) { } z = y if (y is B) { - z.foo() + z.foo() z.bar() } } @@ -40,7 +40,7 @@ fun test_4(y: Any) { x as Int x.inc() x = y - x.inc() + x.inc() if (y is A) { x.foo() y.foo() diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/casts.kt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/casts.kt index dfb08e48fb6..b8dadae553d 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/casts.kt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/casts.kt @@ -15,31 +15,31 @@ fun test_3(b: Boolean, x: Any?) { if (b && x as Boolean) { x.not() } - x.not() + x.not() if (b && x as Boolean == true) { x.not() } - x.not() + x.not() if (b || x as Boolean) { - x.not() + x.not() } - x.not() + x.not() } fun test_4(b: Any) { if (b as? Boolean != null) { b.not() } else { - b.not() + b.not() } - b.not() + b.not() if (b as? Boolean == null) { - b.not() + b.not() } else { b.not() } - b.not() + b.not() } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/returns.kt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/returns.kt index 58f167ec50d..cacf8dcd98e 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/returns.kt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/returns.kt @@ -36,8 +36,8 @@ fun test_2(x: Any) { else -> return } x.foo() - x.bar() - x.baz() + x.bar() + x.baz() } fun test_3(x: Any) { @@ -45,9 +45,9 @@ fun test_3(x: Any) { x is B -> x.bar() x is C -> x.baz() } - x.foo() - x.bar() - x.baz() + x.foo() + x.bar() + x.baz() } fun runHigherOrder(f: () -> T): T = f() diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/loops/endlessLoops.kt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/loops/endlessLoops.kt index bc94abdb650..1776f00f971 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/loops/endlessLoops.kt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/loops/endlessLoops.kt @@ -44,7 +44,7 @@ fun test_4(x: Any, b: Boolean) { } break } - x.foo() // No smartcast + x.foo() // No smartcast } fun test_5(x: Any, b: Boolean) { diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/orInWhenBranch.kt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/orInWhenBranch.kt index 50a6d0cc510..36f096e22e1 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/orInWhenBranch.kt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/orInWhenBranch.kt @@ -4,19 +4,19 @@ fun String.foo() {} fun test_1(a: Any?) { when (a) { - is String, is Any -> a.foo() // Should be Bad + is String, is Any -> a.foo() // Should be Bad } } fun test_2(a: Any?) { if (a is String || a is Any) { - a.foo() // Should be Bad + a.foo() // Should be Bad } } fun test_3(a: Any?, b: Boolean) { when (a) { - is String, b -> a.foo() // Should be Bad + is String, b -> a.foo() // Should be Bad } } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/implicitReceivers.kt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/implicitReceivers.kt index f13a9b24ca5..b1ddb729fcc 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/implicitReceivers.kt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/implicitReceivers.kt @@ -14,23 +14,23 @@ fun Any?.test_1() { this.foo() foo() } else { - this.foo() - foo() + this.foo() + foo() } - this.foo() - foo() + this.foo() + foo() } fun Any?.test_2() { if (this !is A) { - this.foo() - foo() + this.foo() + foo() } else { this.foo() foo() } - this.foo() - foo() + this.foo() + foo() } fun test_3(a: Any, b: Any, c: Any) { @@ -49,13 +49,13 @@ fun test_3(a: Any, b: Any, c: Any) { fun Any?.test_4() { if (this !is A) { - this.foo() - foo() - this.bar() - bar() + this.foo() + foo() + this.bar() + bar() } else if (this !is B) { - this.bar() - bar() + this.bar() + bar() this.foo() foo() } else { @@ -64,10 +64,10 @@ fun Any?.test_4() { this.bar() bar() } - this.foo() - foo() - this.bar() - bar() + this.foo() + foo() + this.bar() + bar() } fun Any.test_5(): Int = when { diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.kt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.kt index 83a74410769..3c681bde320 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.kt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.kt @@ -22,7 +22,7 @@ fun test_3(x: Any) { (x as? A)?.bar(x)?.foo(x.bool())?.let { x.bool() } - x.bool() + x.bool() } fun test_4(x: A?) { diff --git a/compiler/fir/analysis-tests/testData/resolve/typeAliasWithTypeArguments.kt b/compiler/fir/analysis-tests/testData/resolve/typeAliasWithTypeArguments.kt index 997d46d1aaa..5a6f706a61e 100644 --- a/compiler/fir/analysis-tests/testData/resolve/typeAliasWithTypeArguments.kt +++ b/compiler/fir/analysis-tests/testData/resolve/typeAliasWithTypeArguments.kt @@ -42,7 +42,7 @@ fun test_2(inv: Inv2) { fun test_3(inv: Inv3) { inv.k().foo() - inv.t().bar() + inv.t().bar() inv.t().baz() } @@ -74,21 +74,21 @@ typealias Invariant1 = Invariant fun test_5(a: A, in1: In1, in2: In1, in3: In1) { in1.take(a) in2.take(a) - in3.take(a) + in3.take(a) } fun test_6(a: A, out1: Out1, out2: Out1, out3: Out1) { out1.value().foo() - out2.value().foo() + out2.value().foo() out3.value().foo() } fun test_7(a: A, inv1: Invariant1, inv2: Invariant1, inv3: Invariant1) { inv1.value().foo() - inv2.value().foo() + inv2.value().foo() inv3.value().foo() inv1.take(a) inv2.take(a) - inv3.take(a) + inv3.take(a) } diff --git a/compiler/fir/analysis-tests/testData/resolve/visibility/singletonConstructors.kt b/compiler/fir/analysis-tests/testData/resolve/visibility/singletonConstructors.kt index 5fc9f86fa4d..51a43a129e8 100644 --- a/compiler/fir/analysis-tests/testData/resolve/visibility/singletonConstructors.kt +++ b/compiler/fir/analysis-tests/testData/resolve/visibility/singletonConstructors.kt @@ -2,12 +2,12 @@ class A { companion object Comp {} fun foo() { - Comp() + Comp() } } object B { - private val x = B() + private val x = B() } class D { @@ -26,6 +26,6 @@ enum class E { }; fun foo() { - X() + X() } } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/companions.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/companions.kt index bb474ca35cb..17ef4ed5510 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/companions.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/companions.kt @@ -31,16 +31,16 @@ fun main() { foo1(KotlinClass::baz) foo2(KotlinClass::baz) // Ambiguity (companion/class) - foo3(KotlinClass::baz) + foo3(KotlinClass::baz) // Type mismatch - foo1(KotlinClass::bar) + foo1(KotlinClass::bar) foo2(KotlinClass::bar) foo3(KotlinClass::bar) foo1(KotlinClass2::bar) // Type mismatch - foo2(KotlinClass2::bar) + foo2(KotlinClass2::bar) foo3(KotlinClass2::bar) } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/resolveCallableReferencesAfterAllSimpleArguments.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/resolveCallableReferencesAfterAllSimpleArguments.kt index 4c5cb7ea24d..b2332695285 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/resolveCallableReferencesAfterAllSimpleArguments.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/resolveCallableReferencesAfterAllSimpleArguments.kt @@ -7,6 +7,6 @@ fun bar(f: (T) -> Unit, e: T) {} fun baz(e: T, f: (T) -> Unit) {} fun test(a: A, b: B) { - baz(a, ::fooB) - bar(::fooB, a) + baz(a, ::fooB) + bar(::fooB, a) } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/implicitTypes.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/implicitTypes.kt index 3d563c207fd..189e45d3611 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/implicitTypes.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/implicitTypes.kt @@ -3,5 +3,5 @@ fun use(x: (T) -> R): (T) -> R = x fun foo() = use(::bar) fun bar(x: String) = 1 -fun loop1() = use(::loop2) +fun loop1() = use(::loop2) fun loop2() = loop1() diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/javaStatic.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/javaStatic.kt index 04a617ff483..b3057626abe 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/javaStatic.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/javaStatic.kt @@ -16,5 +16,5 @@ fun foo3(x: (String) -> Int) {} fun main() { foo1(JavaClass::bar) foo2(JavaClass::bar) - foo3(JavaClass::bar) + foo3(JavaClass::bar) } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/manyInnermanyOuterCandidatesAmbiguity.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/manyInnermanyOuterCandidatesAmbiguity.kt index 3ba452fd246..10944f406ca 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/manyInnermanyOuterCandidatesAmbiguity.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/manyInnermanyOuterCandidatesAmbiguity.kt @@ -6,5 +6,5 @@ fun bar(): Int = 1 fun bar(x: String): Int = 1 fun main() { - foo(::bar) + foo(::bar) } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/booleanOperators.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/booleanOperators.kt index 3029d26ca7b..e310196c7fe 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/booleanOperators.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/booleanOperators.kt @@ -59,8 +59,8 @@ fun test_2(x: Any) { fun test_3(x: Any) { myRequireOr(x is B, x is C) x.foo() // OK - x.bar() // Error - x.baz() // Error + x.bar() // Error + x.baz() // Error } fun test_4(x: Any) { diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/JavaVisibility2.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/JavaVisibility2.kt index 32b967e2377..46bc2d36099 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/JavaVisibility2.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/JavaVisibility2.kt @@ -27,8 +27,8 @@ class A { val p3 = JavaProtected().javaPProtectedPackage fun test() { - JavaProtected.javaMProtectedStatic() - JavaPackageLocal.javaMPackage() + JavaProtected.javaMProtectedStatic() + JavaPackageLocal.javaMPackage() } } @@ -39,7 +39,7 @@ class B : JavaProtected() { fun test() { JavaProtected.javaMProtectedStatic() - JavaPackageLocal.javaMPackage() + JavaPackageLocal.javaMPackage() } } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KJKComplexHierarchyWithNested.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KJKComplexHierarchyWithNested.kt index 99df059cf1c..e8c12d5cbf3 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KJKComplexHierarchyWithNested.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KJKComplexHierarchyWithNested.kt @@ -5,9 +5,9 @@ fun main(k: KSub, vString: SuperClass.NestedInSuperClass, vInt: SuperCla k.getImpl().nestedI(vString) // TODO: Support parametrisized inner classes - k.getImpl().nestedI(vInt) + k.getImpl().nestedI(vInt) k.getNestedSubClass().nested("") - k.getNestedSubClass().nested(1) + k.getNestedSubClass().nested(1) } // FILE: J1.java diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KotlinClassParameter.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KotlinClassParameter.kt index c9c89e70850..c2256f265e2 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KotlinClassParameter.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KotlinClassParameter.kt @@ -9,5 +9,5 @@ public class JavaClass { // FILE: K2.kt fun main() { JavaClass.baz(KotlinClass()) - JavaClass.baz("") + JavaClass.baz("") } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KotlinClassParameterGeneric.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KotlinClassParameterGeneric.kt index 972831a8220..970b06ffc7e 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KotlinClassParameterGeneric.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KotlinClassParameterGeneric.kt @@ -10,6 +10,6 @@ public class JavaClass { fun main() { JavaClass.baz(KotlinClass()) JavaClass.baz(KotlinClass()) - JavaClass.baz(KotlinClass()) - JavaClass.baz("") + JavaClass.baz(KotlinClass()) + JavaClass.baz("") } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/KJKComplexHierarchyNestedLoop.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/KJKComplexHierarchyNestedLoop.kt index a28bf427821..151031d03c9 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/KJKComplexHierarchyNestedLoop.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/KJKComplexHierarchyNestedLoop.kt @@ -2,11 +2,11 @@ class K2: J1() { class Q : Nested() fun bar() { - foo() - baz() + foo() + baz() - superClass() - superI() + superClass() + superI() } } diff --git a/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/DiagnosticData.kt b/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/DiagnosticData.kt index 6ca5292d888..0e24e36d23b 100644 --- a/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/DiagnosticData.kt +++ b/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/DiagnosticData.kt @@ -43,6 +43,7 @@ enum class PositioningStrategy(private val strategy: String) { VARIANCE_MODIFIER("VARIANCE_MODIFIER"), LATEINIT_MODIFIER("LATEINIT_MODIFIER"), SELECTOR_BY_QUALIFIED("SELECTOR_BY_QUALIFIED"), + REFERENCE_BY_QUALIFIED("REFERENCE_BY_QUALIFIED"), ; diff --git a/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/FirDiagnosticsList.kt b/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/FirDiagnosticsList.kt index 3ca0d8635e2..a0b79fab942 100644 --- a/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/FirDiagnosticsList.kt +++ b/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/FirDiagnosticsList.kt @@ -45,10 +45,10 @@ object DIAGNOSTICS_LIST : DiagnosticList() { } val UNRESOLVED by object : DiagnosticGroup("Unresolved") { - val HIDDEN by error { + val HIDDEN by error(PositioningStrategy.REFERENCE_BY_QUALIFIED) { parameter>("hidden") } - val UNRESOLVED_REFERENCE by error { + val UNRESOLVED_REFERENCE by error(PositioningStrategy.REFERENCE_BY_QUALIFIED) { parameter("reference") } val UNRESOLVED_LABEL by error() @@ -62,7 +62,7 @@ object DIAGNOSTICS_LIST : DiagnosticList() { val SUPER by object : DiagnosticGroup("Super") { val SUPER_IS_NOT_AN_EXPRESSION by error() val SUPER_NOT_AVAILABLE by error() - val ABSTRACT_SUPER_CALL by error() + val ABSTRACT_SUPER_CALL by error(PositioningStrategy.REFERENCE_BY_QUALIFIED) val INSTANCE_ACCESS_BEFORE_SUPER_CALL by error { parameter("target") } @@ -152,20 +152,21 @@ object DIAGNOSTICS_LIST : DiagnosticList() { } val APPLICABILITY by object : DiagnosticGroup("Applicability") { - val NONE_APPLICABLE by error { + val NONE_APPLICABLE by error(PositioningStrategy.REFERENCE_BY_QUALIFIED) { parameter>>("candidates") } - val INAPPLICABLE_CANDIDATE by error { + val INAPPLICABLE_CANDIDATE by error(PositioningStrategy.REFERENCE_BY_QUALIFIED) { parameter>("candidate") } + val INAPPLICABLE_LATEINIT_MODIFIER by error(PositioningStrategy.LATEINIT_MODIFIER) { parameter("reason") } } val AMBIGUIRY by object : DiagnosticGroup("Ambiguity") { - val AMBIGUITY by error { + val AMBIGUITY by error(PositioningStrategy.REFERENCE_BY_QUALIFIED) { parameter>>("candidates") } val ASSIGN_OPERATOR_AMBIGUITY by error { @@ -364,7 +365,7 @@ object DIAGNOSTICS_LIST : DiagnosticList() { val UNSAFE_CALL by error(PositioningStrategy.DOT_BY_QUALIFIED) { parameter("receiverType") } - val UNSAFE_IMPLICIT_INVOKE_CALL by error { + val UNSAFE_IMPLICIT_INVOKE_CALL by error(PositioningStrategy.REFERENCE_BY_QUALIFIED) { parameter("receiverType") } val UNSAFE_INFIX_CALL by error { diff --git a/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt b/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt index 30eb6beba1e..0c04d5c6dcc 100644 --- a/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt +++ b/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt @@ -63,8 +63,8 @@ object FirErrors { val DELEGATION_IN_INTERFACE by error0() // Unresolved - val HIDDEN by error1>() - val UNRESOLVED_REFERENCE by error1() + val HIDDEN by error1>(SourceElementPositioningStrategies.REFERENCE_BY_QUALIFIED) + val UNRESOLVED_REFERENCE by error1(SourceElementPositioningStrategies.REFERENCE_BY_QUALIFIED) val UNRESOLVED_LABEL by error0() val DESERIALIZATION_ERROR by error0() val ERROR_FROM_JAVA_RESOLUTION by error0() @@ -75,7 +75,7 @@ object FirErrors { // Super val SUPER_IS_NOT_AN_EXPRESSION by error0() val SUPER_NOT_AVAILABLE by error0() - val ABSTRACT_SUPER_CALL by error0() + val ABSTRACT_SUPER_CALL by error0(SourceElementPositioningStrategies.REFERENCE_BY_QUALIFIED) val INSTANCE_ACCESS_BEFORE_SUPER_CALL by error1() // Supertypes @@ -139,12 +139,12 @@ object FirErrors { val REDUNDANT_OPEN_IN_INTERFACE by warning0(SourceElementPositioningStrategies.OPEN_MODIFIER) // Applicability - val NONE_APPLICABLE by error1>>() - val INAPPLICABLE_CANDIDATE by error1>() + val NONE_APPLICABLE by error1>>(SourceElementPositioningStrategies.REFERENCE_BY_QUALIFIED) + val INAPPLICABLE_CANDIDATE by error1>(SourceElementPositioningStrategies.REFERENCE_BY_QUALIFIED) val INAPPLICABLE_LATEINIT_MODIFIER by error1(SourceElementPositioningStrategies.LATEINIT_MODIFIER) // Ambiguity - val AMBIGUITY by error1>>() + val AMBIGUITY by error1>>(SourceElementPositioningStrategies.REFERENCE_BY_QUALIFIED) val ASSIGN_OPERATOR_AMBIGUITY by error1>>() // Types & type parameters @@ -235,7 +235,7 @@ object FirErrors { // Nullability val UNSAFE_CALL by error1(SourceElementPositioningStrategies.DOT_BY_QUALIFIED) - val UNSAFE_IMPLICIT_INVOKE_CALL by error1() + val UNSAFE_IMPLICIT_INVOKE_CALL by error1(SourceElementPositioningStrategies.REFERENCE_BY_QUALIFIED) val UNSAFE_INFIX_CALL by error3() val UNSAFE_OPERATOR_CALL by error3() diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/LightTreePositioningStrategies.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/LightTreePositioningStrategies.kt index d48905957ae..00b2921b796 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/LightTreePositioningStrategies.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/LightTreePositioningStrategies.kt @@ -347,6 +347,32 @@ object LightTreePositioningStrategies { } } + val REFERENCE_BY_QUALIFIED: LightTreePositioningStrategy = object : LightTreePositioningStrategy() { + override fun mark( + node: LighterASTNode, + startOffset: Int, + endOffset: Int, + tree: FlyweightCapableTreeStructure + ): List { + if (node.tokenType == KtNodeTypes.CALL_EXPRESSION || node.tokenType == KtNodeTypes.CONSTRUCTOR_DELEGATION_CALL) { + return markElement(tree.referenceExpression(node) ?: node, startOffset, endOffset, tree, node) + } + if (node.tokenType != KtNodeTypes.DOT_QUALIFIED_EXPRESSION && node.tokenType != KtNodeTypes.SAFE_ACCESS_EXPRESSION) { + return super.mark(node, startOffset, endOffset, tree) + } + val selector = tree.selector(node) + if (selector != null) { + when (selector.tokenType) { + KtNodeTypes.REFERENCE_EXPRESSION -> + return markElement(selector, startOffset, endOffset, tree, node) + KtNodeTypes.CALL_EXPRESSION, KtNodeTypes.CONSTRUCTOR_DELEGATION_CALL -> + return markElement(tree.referenceExpression(selector) ?: selector, startOffset, endOffset, tree, node) + } + } + return super.mark(node, startOffset, endOffset, tree) + } + } + val WHEN_EXPRESSION = object : LightTreePositioningStrategy() { override fun mark( node: LighterASTNode, @@ -400,6 +426,14 @@ private fun FlyweightCapableTreeStructure.nameIdentifier(node: L private fun FlyweightCapableTreeStructure.operationReference(node: LighterASTNode): LighterASTNode? = findChildByType(node, KtNodeTypes.OPERATION_REFERENCE) +private fun FlyweightCapableTreeStructure.referenceExpression(node: LighterASTNode): LighterASTNode? { + val childrenRef = Ref>() + getChildren(node, childrenRef) + return childrenRef.get()?.firstOrNull { + it?.tokenType == KtNodeTypes.REFERENCE_EXPRESSION || it?.tokenType == KtNodeTypes.CONSTRUCTOR_DELEGATION_REFERENCE + } +} + private fun FlyweightCapableTreeStructure.rightParenthesis(node: LighterASTNode): LighterASTNode? = findChildByType(node, KtTokens.RPAR) diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/SourceElementPositioningStrategies.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/SourceElementPositioningStrategies.kt index 6e006527cb2..489dcb6b5d7 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/SourceElementPositioningStrategies.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/SourceElementPositioningStrategies.kt @@ -108,6 +108,11 @@ object SourceElementPositioningStrategies { PositioningStrategies.SELECTOR_BY_QUALIFIED ) + val REFERENCE_BY_QUALIFIED = SourceElementPositioningStrategy( + LightTreePositioningStrategies.REFERENCE_BY_QUALIFIED, + PositioningStrategies.REFERENCE_BY_QUALIFIED + ) + val WHEN_EXPRESSION = SourceElementPositioningStrategy( LightTreePositioningStrategies.WHEN_EXPRESSION, PositioningStrategies.WHEN_EXPRESSION diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/PositioningStrategies.kt b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/PositioningStrategies.kt index 3848d8afb95..2d1cdd07752 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/PositioningStrategies.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/PositioningStrategies.kt @@ -732,4 +732,20 @@ object PositioningStrategies { return super.mark(element) } } + + val REFERENCE_BY_QUALIFIED: PositioningStrategy = object : PositioningStrategy() { + override fun mark(element: PsiElement): List { + when (element) { + is KtQualifiedExpression -> { + when (val selectorExpression = element.selectorExpression) { + is KtCallExpression -> return mark(selectorExpression.calleeExpression ?: selectorExpression) + is KtReferenceExpression -> return mark(selectorExpression) + } + } + is KtCallExpression -> return mark(element.calleeExpression ?: element) + is KtConstructorDelegationCall -> return mark(element.calleeExpression ?: element) + } + return super.mark(element) + } + } } diff --git a/compiler/testData/diagnostics/tests/DeprecatedGetSetPropertyDelegateConvention.fir.kt b/compiler/testData/diagnostics/tests/DeprecatedGetSetPropertyDelegateConvention.fir.kt index c067f6bb367..2da4f2f2f99 100644 --- a/compiler/testData/diagnostics/tests/DeprecatedGetSetPropertyDelegateConvention.fir.kt +++ b/compiler/testData/diagnostics/tests/DeprecatedGetSetPropertyDelegateConvention.fir.kt @@ -33,8 +33,8 @@ operator fun CustomDelegate3.setValue(thisRef: Any?, prop: KProperty<*>, value: class Example { - var a by CustomDelegate() - val aval by CustomDelegate() + var a by CustomDelegate() + val aval by CustomDelegate() var b by OkDelegate() var c by CustomDelegate2() var d by CustomDelegate3() diff --git a/compiler/testData/diagnostics/tests/FunctionCalleeExpressions.fir.kt b/compiler/testData/diagnostics/tests/FunctionCalleeExpressions.fir.kt index 6a62617d900..29bae925d54 100644 --- a/compiler/testData/diagnostics/tests/FunctionCalleeExpressions.fir.kt +++ b/compiler/testData/diagnostics/tests/FunctionCalleeExpressions.fir.kt @@ -28,20 +28,20 @@ fun fooT2() : (t : T) -> T { fun main(args : Array) { args.foo()() - args.foo1()() - a.foo1()() + args.foo1()() + a.foo1()() a.foo1()(a) args.foo1()(1) - args.foo1()("1") - a.foo1()("1") + args.foo1()("1") + a.foo1()("1") a.foo1()(a) foo2()({}) foo2(){} (foo2()){} - (foo2()){x -> } - foo2()({x -> }) + (foo2()){x -> } + foo2()({x -> }) val a = fooT1(1)() checkSubtype(a) @@ -50,25 +50,25 @@ fun main(args : Array) { checkSubtype(b) fooT2()(1) // : Any? - 1() - 1{} - 1(){} + 1() + 1{} + 1(){} } fun f() : Int.() -> Unit = {} fun main1() { - 1.(fun Int.() = 1)(); + 1.(fun Int.() = 1)(); {1}(); (fun (x : Int) = x)(1) - 1.(fun Int.(x : Int) = x)(1); + 1.(fun Int.(x : Int) = x)(1); l@{1}() - 1.((fun Int.() = 1))() - 1.(f())() - 1.if(true){f()}else{f()}() - 1.if(true)(fun Int.() {})else{f()}() + 1.((fun Int.() = 1))() + 1.(f())() + 1.if(true){f()}else{f()}() + 1.if(true)(fun Int.() {})else{f()}() - 1."sdf"() + 1."sdf"() 1."sdf" 1.{} @@ -76,12 +76,12 @@ fun main1() { } fun test() { - {x : Int -> 1}(); - (fun Int.() = 1)() - "sd".(fun Int.() = 1)() + {x : Int -> 1}(); + (fun Int.() = 1)() + "sd".(fun Int.() = 1)() val i : Int? = null - i.(fun Int.() = 1)(); - {}() - 1?.(fun Int.() = 1)() - 1.{}() + i.(fun Int.() = 1)(); + {}() + 1?.(fun Int.() = 1)() + 1.{}() } 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 f4bdfdadd4c..892c511bd7b 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/function/fakeOverrideType.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/fakeOverrideType.fir.kt index 89bbbfa27c2..f2dac1b0c43 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/fakeOverrideType.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/fakeOverrideType.fir.kt @@ -13,5 +13,5 @@ class B : A() { fun test() { B::foo checkType { _>() } - (B::hashCode)("No.") + (B::hashCode)("No.") } diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/fieldAsClassDelegate.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/fieldAsClassDelegate.fir.kt index 28cae30c997..9a21bc9308d 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/fieldAsClassDelegate.fir.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/fieldAsClassDelegate.fir.kt @@ -29,7 +29,7 @@ private fun lazy(init: () -> T): kotlin.Lazy { } object DefaultHttpClientWithBy : HttpClient by client { - val client by lazy { HttpClientImpl() } + val client by lazy { HttpClientImpl() } } object DefaultFqHttpClient : HttpClient by DefaultFqHttpClient.client { diff --git a/compiler/testData/diagnostics/tests/declarationChecks/localVariablesWithTypeParameters_1_3.fir.kt b/compiler/testData/diagnostics/tests/declarationChecks/localVariablesWithTypeParameters_1_3.fir.kt index 5539b97ee64..7276f6c9207 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/localVariablesWithTypeParameters_1_3.fir.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/localVariablesWithTypeParameters_1_3.fir.kt @@ -11,7 +11,7 @@ fun test() { const val a3 = 0 lateinit val a4 = 0 val a5 by Delegate() - val a6 by Delegate<T>() + val a6 by Delegate<T>() } class Delegate { diff --git a/compiler/testData/diagnostics/tests/declarationChecks/localVariablesWithTypeParameters_1_4.fir.kt b/compiler/testData/diagnostics/tests/declarationChecks/localVariablesWithTypeParameters_1_4.fir.kt index e86865131dd..8d09b2a5612 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/localVariablesWithTypeParameters_1_4.fir.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/localVariablesWithTypeParameters_1_4.fir.kt @@ -11,7 +11,7 @@ fun test() { const val a3 = 0 lateinit val a4 = 0 val a5 by Delegate() - val a6 by Delegate<T>() + val a6 by Delegate<T>() } class Delegate { diff --git a/compiler/testData/diagnostics/tests/declarationChecks/namedFunAsLastExpressionInBlock.fir.kt b/compiler/testData/diagnostics/tests/declarationChecks/namedFunAsLastExpressionInBlock.fir.kt index 991fc0fe076..7ad3ec07b8b 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/namedFunAsLastExpressionInBlock.fir.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/namedFunAsLastExpressionInBlock.fir.kt @@ -45,7 +45,7 @@ fun test() { x4 checkType { _>() } { y: Int -> fun named14(): Int {return 1} } - val b = (fun named15(): Boolean { return true })() + val b = (fun named15(): Boolean { return true })() baz(fun named16(){}) } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/incompleteTypeInference.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/incompleteTypeInference.fir.kt index 12ee9c9e9e1..36688c7fa71 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/incompleteTypeInference.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/incompleteTypeInference.fir.kt @@ -5,10 +5,10 @@ import kotlin.reflect.KProperty class A class D { - val c: Int by IncorrectThis() + val c: Int by IncorrectThis() } -val cTopLevel: Int by IncorrectThis() +val cTopLevel: Int by IncorrectThis() class IncorrectThis { fun get(t: Any?, p: KProperty<*>): Int { diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionProperty.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionProperty.fir.kt index a2b3d2a91a0..bbe1ab30618 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionProperty.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionProperty.fir.kt @@ -4,10 +4,10 @@ package foo import kotlin.reflect.KProperty open class A { - val B.w: Int by MyProperty() + val B.w: Int by MyProperty() } -val B.r: Int by MyProperty() +val B.r: Int by MyProperty() val A.e: Int by MyProperty() diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/manyIncompleteCandidates.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/manyIncompleteCandidates.fir.kt index 6fc5a1d7f20..9039756c190 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/manyIncompleteCandidates.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/manyIncompleteCandidates.fir.kt @@ -5,7 +5,7 @@ package test import first.* import second.* -val a12 by A() +val a12 by A() // FILE: first.kt package first diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/kt4640.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/kt4640.fir.kt index beac5cea63f..fb962e9965d 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/kt4640.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/kt4640.fir.kt @@ -8,4 +8,4 @@ class ValueWrapper() fun setValue(v: Int) { backingValue = v } } -val foo by ValueWrapper() +val foo by ValueWrapper() diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/missedGetter.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/missedGetter.fir.kt index 270badeb52d..2433947dafe 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/missedGetter.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/missedGetter.fir.kt @@ -1,3 +1,3 @@ -val a: Int by A() +val a: Int by A() class A diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/propertyDefferedType.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/propertyDefferedType.fir.kt index 7ad8d8e86df..90b54acd693 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/propertyDefferedType.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/propertyDefferedType.fir.kt @@ -5,7 +5,7 @@ import kotlin.reflect.KProperty class B { - val c by Delegate(ag) + val c by Delegate(ag) } class Delegate(val init: T) { diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver2.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver2.fir.kt index 6fb1bd69fdd..840e8feb846 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver2.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver2.fir.kt @@ -10,5 +10,5 @@ object T2 { operator fun Foo.getValue(receiver: String, p: Any?): T = TODO() val String.test1: String by delegate() - val test2: String by delegate() + val test2: String by delegate() } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/thisOfNothingNullableType.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/thisOfNothingNullableType.fir.kt index 3a826e00878..a52285427e2 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/thisOfNothingNullableType.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/thisOfNothingNullableType.fir.kt @@ -4,7 +4,7 @@ import kotlin.reflect.KProperty class A { - var a: Int by Delegate() + var a: Int by Delegate() } var aTopLevel: Int by Delegate() diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/thisOfNothingType.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/thisOfNothingType.fir.kt index 405dee83558..69230fdcd4a 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/thisOfNothingType.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/thisOfNothingType.fir.kt @@ -4,10 +4,10 @@ import kotlin.reflect.KProperty class A { - var a: Int by Delegate() + var a: Int by Delegate() } -var aTopLevel: Int by Delegate() +var aTopLevel: Int by Delegate() class Delegate { fun getValue(t: Nothing, p: KProperty<*>): Int { diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/twoGetMethods.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/twoGetMethods.fir.kt index d7a9c9067f1..b9cac34cd3c 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/twoGetMethods.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/twoGetMethods.fir.kt @@ -3,7 +3,7 @@ import kotlin.reflect.KProperty class A { - val c: Int by Delegate() + val c: Int by Delegate() } class Delegate { diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetWithGeneric.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetWithGeneric.fir.kt index fc65950992f..aa603f3f806 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetWithGeneric.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetWithGeneric.fir.kt @@ -5,10 +5,10 @@ import kotlin.reflect.KProperty class A class B { - val b: Int by Delegate() + val b: Int by Delegate() } -val bTopLevel: Int by Delegate() +val bTopLevel: Int by Delegate() class C { val c: Int by Delegate() diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForThisGetParameter.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForThisGetParameter.fir.kt index 8058a494f55..41ba3d5bafe 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForThisGetParameter.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForThisGetParameter.fir.kt @@ -4,10 +4,10 @@ import kotlin.reflect.KProperty class B { - val b: Int by Delegate() + val b: Int by Delegate() } -val bTopLevel: Int by Delegate() +val bTopLevel: Int by Delegate() class A diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/wrongCountOfParametersInGet.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/wrongCountOfParametersInGet.fir.kt index 1a8e7d9ffb3..f9f35f93c16 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/wrongCountOfParametersInGet.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/wrongCountOfParametersInGet.fir.kt @@ -3,10 +3,10 @@ import kotlin.reflect.KProperty class A { - val a: Int by Delegate() + val a: Int by Delegate() } -val aTopLevel: Int by Delegate() +val aTopLevel: Int by Delegate() class Delegate { fun getValue(t: Any?, p: KProperty<*>, a: Int): Int { diff --git a/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver.fir.kt b/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver.fir.kt index 138db690973..5e36f04c40f 100644 --- a/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver.fir.kt +++ b/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver.fir.kt @@ -35,7 +35,7 @@ fun test4() { // should be an error on receiver, shouldn't be thrown away fun test5() { - 1.(fun String.()=1)() + 1.(fun String.()=1)() } fun R?.sure() : R = this!! diff --git a/compiler/testData/diagnostics/tests/functionLiterals/DeprecatedSyntax.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/DeprecatedSyntax.fir.kt index 8111b18415b..85ce9597a68 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/DeprecatedSyntax.fir.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/DeprecatedSyntax.fir.kt @@ -1,9 +1,9 @@ // !WITH_NEW_INFERENCE val receiver = { Int.() -> } -val receiverWithParameter = { Int.(a) -> } +val receiverWithParameter = { Int.(a) -> } val receiverAndReturnType = { Int.(): Int -> 5 } -val receiverAndReturnTypeWithParameter = { Int.(a: Int): Int -> 5 } +val receiverAndReturnTypeWithParameter = { Int.(a: Int): Int -> 5 } val returnType = { (): Int -> 5 } val returnTypeWithParameter = { (b: Int): Int -> 5 } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/kt6541_extensionForExtensionFunction.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/kt6541_extensionForExtensionFunction.fir.kt index db815efa470..64001baabe3 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/kt6541_extensionForExtensionFunction.fir.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/kt6541_extensionForExtensionFunction.fir.kt @@ -7,4 +7,4 @@ object Z { infix fun add(b : Foo.() -> Unit) : Z = Z } -val t2 = Z add { } { } +val t2 = Z add { } { } diff --git a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/valWithNoNameInBlock.fir.kt b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/valWithNoNameInBlock.fir.kt index 26b87f01991..8d48bd43e6f 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/valWithNoNameInBlock.fir.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/valWithNoNameInBlock.fir.kt @@ -40,7 +40,7 @@ fun foo() { property1 = 1 val - propertyWithBy by lazy { 1 } + propertyWithBy by lazy { 1 } val propertyWithType: Int diff --git a/compiler/testData/diagnostics/tests/inference/invokeLambdaAsFunction.fir.kt b/compiler/testData/diagnostics/tests/inference/invokeLambdaAsFunction.fir.kt index 7d238420de8..89d7abf1986 100644 --- a/compiler/testData/diagnostics/tests/inference/invokeLambdaAsFunction.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/invokeLambdaAsFunction.fir.kt @@ -2,6 +2,6 @@ fun test1(i: Int) = { i -> i }(i) -fun test2() = { i -> i }() +fun test2() = { i -> i }() fun test3() = { i -> i }(1) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/kt435.fir.kt b/compiler/testData/diagnostics/tests/kt435.fir.kt index aec09116fa8..c24f1f89f78 100644 --- a/compiler/testData/diagnostics/tests/kt435.fir.kt +++ b/compiler/testData/diagnostics/tests/kt435.fir.kt @@ -3,5 +3,5 @@ fun Any.foo1() : (i : Int) -> Unit { } fun test(a : Any) { - a.foo1()() + a.foo1()() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/objects/Objects.fir.kt b/compiler/testData/diagnostics/tests/objects/Objects.fir.kt index fcaee4376e2..2b8bb4061c0 100644 --- a/compiler/testData/diagnostics/tests/objects/Objects.fir.kt +++ b/compiler/testData/diagnostics/tests/objects/Objects.fir.kt @@ -6,13 +6,13 @@ package toplevelObjectDeclarations class T : Foo {} - object A : Foo { + object A : Foo { val x : Int = 2 fun test() : Int { return x + foo() } - } + } object B : A {} diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/delegatedProperties.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/delegatedProperties.fir.kt index 6b6b626d5a5..d8b760b83c7 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/delegatedProperties.fir.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/delegatedProperties.fir.kt @@ -19,5 +19,5 @@ public class J { // FILE: k.kt var A by J.staticNN -var B by J.staticN +var B by J.staticN var C by J.staticJ \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/qualifiedExpression/calleeExpressionAsCallExpression.fir.kt b/compiler/testData/diagnostics/tests/qualifiedExpression/calleeExpressionAsCallExpression.fir.kt index bcc9b5931bc..e1d94c8f043 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/regressions/kt26303.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt26303.fir.kt index dbfa13fb0f5..39472371d47 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt26303.fir.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt26303.fir.kt @@ -14,5 +14,5 @@ import foo.foo as invoke import foo.invoke fun main(args: Array) { - 42() + 42() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/errors/ambiguityForInvoke.fir.kt b/compiler/testData/diagnostics/tests/resolve/invoke/errors/ambiguityForInvoke.fir.kt index dd3251bb346..ab2ff938366 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/errors/ambiguityForInvoke.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/errors/ambiguityForInvoke.fir.kt @@ -7,5 +7,5 @@ fun Int.invoke(a: Any, i: Int) {} fun foo(i: Int) { i(1, 1) - 5(1, 2) + 5(1, 2) } diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/errors/invisibleInvoke.fir.kt b/compiler/testData/diagnostics/tests/resolve/invoke/errors/invisibleInvoke.fir.kt index d11dc63cba4..46c0ce68894 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/errors/invisibleInvoke.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/errors/invisibleInvoke.fir.kt @@ -6,5 +6,5 @@ class My { fun My.foo(i: Int) { i("") - 1("") + 1("") } diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/errors/receiverPresenceErrorForInvoke.fir.kt b/compiler/testData/diagnostics/tests/resolve/invoke/errors/receiverPresenceErrorForInvoke.fir.kt index 107f01d0c61..e02acf7781b 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/errors/receiverPresenceErrorForInvoke.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/errors/receiverPresenceErrorForInvoke.fir.kt @@ -7,5 +7,5 @@ fun test1(f: String.() -> Unit) { fun test2(f: (Int) -> Int) { 1.f(2) - 2.(f)(2) + 2.(f)(2) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/errors/typeInferenceErrorForInvoke.fir.kt b/compiler/testData/diagnostics/tests/resolve/invoke/errors/typeInferenceErrorForInvoke.fir.kt index 0874328e546..40954777dd8 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/errors/typeInferenceErrorForInvoke.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/errors/typeInferenceErrorForInvoke.fir.kt @@ -10,5 +10,5 @@ fun foo(s: String, ai: A) { s(ai) - ""(ai) + ""(ai) } diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/errors/unresolvedInvoke.fir.kt b/compiler/testData/diagnostics/tests/resolve/invoke/errors/unresolvedInvoke.fir.kt index 0874f5b7d95..c42be06db89 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/errors/unresolvedInvoke.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/errors/unresolvedInvoke.fir.kt @@ -1,5 +1,5 @@ // !DIAGNOSTICS: -UNUSED_EXPRESSION fun foo(i: Int) { i() - 1() + 1() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/errors/unsafeCallWithInvoke.fir.kt b/compiler/testData/diagnostics/tests/resolve/invoke/errors/unsafeCallWithInvoke.fir.kt index 27539cd2175..cde534b69f7 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/errors/unsafeCallWithInvoke.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/errors/unsafeCallWithInvoke.fir.kt @@ -6,5 +6,5 @@ operator fun String.invoke(i: Int) {} fun foo(s: String?) { s(1) - (s ?: null)(1) + (s ?: null)(1) } diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/errors/wrongReceiverForInvokeOnExpression.fir.kt b/compiler/testData/diagnostics/tests/resolve/invoke/errors/wrongReceiverForInvokeOnExpression.fir.kt index 85b8d534ef0..5a3559b9135 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/errors/wrongReceiverForInvokeOnExpression.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/errors/wrongReceiverForInvokeOnExpression.fir.kt @@ -1,17 +1,17 @@ // !WITH_NEW_INFERENCE fun test1() { - 1. (fun String.(i: Int) = i )(1) - 1.(label@ fun String.(i: Int) = i )(1) + 1. (fun String.(i: Int) = i )(1) + 1.(label@ fun String.(i: Int) = i )(1) } fun test2(f: String.(Int) -> Unit) { - 11.(f)(1) - 11.(f)() + 11.(f)(1) + 11.(f)() } fun test3() { fun foo(): String.(Int) -> Unit = {} - 1.(foo())(1) + 1.(foo())(1) } diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/errors/wrongReceiverTypeForInvoke.fir.kt b/compiler/testData/diagnostics/tests/resolve/invoke/errors/wrongReceiverTypeForInvoke.fir.kt index e99d2def1c2..e8d87240b9e 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/errors/wrongReceiverTypeForInvoke.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/errors/wrongReceiverTypeForInvoke.fir.kt @@ -6,5 +6,5 @@ fun String.invoke(i: Int) {} fun foo(i: Int) { i(1) - 1(1) + 1(1) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAndSmartCast.fir.kt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAndSmartCast.fir.kt index 41aeacd7829..8af8d45ccec 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAndSmartCast.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAndSmartCast.fir.kt @@ -2,17 +2,17 @@ class A(val x: (String.() -> Unit)?) fun test(a: A) { if (a.x != null) { - "".(a.x)() + "".(a.x)() a.x("") // todo (a.x)("") } - "".(a.x)() + "".(a.x)() a.x("") - (a.x)("") + (a.x)("") with("") { a.x() - (a.x)() + (a.x)() if (a.x != null) { a.x() // todo (a.x)() diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeOnVariableWithExtensionFunctionType.fir.kt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeOnVariableWithExtensionFunctionType.fir.kt index 52919c92464..2ee6ca48bc2 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeOnVariableWithExtensionFunctionType.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/invokeOnVariableWithExtensionFunctionType.fir.kt @@ -8,7 +8,7 @@ class B val A.foo: B.() -> Unit get() = {} fun test(a: A, b: B) { - b.(a.foo)() + b.(a.foo)() (a.foo)(b) a.foo(b) @@ -17,7 +17,7 @@ fun test(a: A, b: B) { b.(foo)() - (b.foo)() + (b.foo)() foo(b) (foo)(b) @@ -25,7 +25,7 @@ fun test(a: A, b: B) { with(b) { a.foo() - a.(foo)() + a.(foo)() (a.foo)() @@ -50,7 +50,7 @@ class A { class B fun test(a: A, b: B) { - b.(a.foo)() + b.(a.foo)() (a.foo)(b) a.foo(b) @@ -59,7 +59,7 @@ fun test(a: A, b: B) { b.(foo)() - (b.foo)() + (b.foo)() foo(b) (foo)(b) @@ -67,7 +67,7 @@ fun test(a: A, b: B) { with(b) { a.foo() - a.(foo)() + a.(foo)() (a.foo)() diff --git a/compiler/testData/diagnostics/tests/safeCall.fir.kt b/compiler/testData/diagnostics/tests/safeCall.fir.kt deleted file mode 100644 index 6e02bc3303b..00000000000 --- a/compiler/testData/diagnostics/tests/safeCall.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// !WITH_NEW_INFERENCE - -fun f(s: String, action: (String.() -> Unit)?) { - s.foo().bar().action() -} - -fun String.foo() = "" - -fun String.bar() = "" - -// -------------------------------------------------------- - -val functions: Map Any> = TODO() - -fun run(name: String) = functions[name]() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/safeCall.kt b/compiler/testData/diagnostics/tests/safeCall.kt index 66185463af1..3c822ca8f69 100644 --- a/compiler/testData/diagnostics/tests/safeCall.kt +++ b/compiler/testData/diagnostics/tests/safeCall.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !WITH_NEW_INFERENCE fun f(s: String, action: (String.() -> Unit)?) { diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/operatorCall.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/operatorCall.fir.kt index 6f999a9d56c..dd21d05a845 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/operatorCall.fir.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/operatorCall.fir.kt @@ -5,7 +5,7 @@ class D : C { { val s = "" s() - ""() + ""() 42 }()) diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/implicitSuperCallErrorsIfPrimary.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/implicitSuperCallErrorsIfPrimary.fir.kt index a91d28edfc5..dabba36c8a7 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/implicitSuperCallErrorsIfPrimary.fir.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/implicitSuperCallErrorsIfPrimary.fir.kt @@ -2,6 +2,6 @@ open class A(p1: String) class B() : A("") { - constructor(s: String) { + constructor(s: String) { } } diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/nestedExtendsInner.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/nestedExtendsInner.fir.kt index c0ca6c46513..478b4d07216 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/nestedExtendsInner.fir.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/nestedExtendsInner.fir.kt @@ -2,6 +2,6 @@ class A { open inner class Inner class Nested : Inner { - constructor() + constructor() } } diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/reportResolutionErrorOnImplicitOnce.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/reportResolutionErrorOnImplicitOnce.fir.kt index 6c9596db92b..f2ab1ac6ddf 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/reportResolutionErrorOnImplicitOnce.fir.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/reportResolutionErrorOnImplicitOnce.fir.kt @@ -2,5 +2,5 @@ open class A(p1: String, p2: String, p3: String, p4: String, p5: String) class B : A { - constructor(s: String) + constructor(s: String) } diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-4/neg/1.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-4/neg/1.1.fir.kt index 456fc81b1a0..1190f320a02 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-4/neg/1.1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-4/neg/1.1.fir.kt @@ -17,7 +17,7 @@ fun case1() { } class B() { - val p: String by Delegate() // DELEGATE_SPECIAL_FUNCTION_MISSING expected + val p: String by Delegate() // DELEGATE_SPECIAL_FUNCTION_MISSING expected } class Delegate { @@ -42,7 +42,7 @@ fun case2() { } class B() { - var p: String by Delegate() // DELEGATE_SPECIAL_FUNCTION_MISSING expected + var p: String by Delegate() // DELEGATE_SPECIAL_FUNCTION_MISSING expected } class Delegate { 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-17/neg/2.1.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-17/neg/2.1.fir.kt index 4db6e3767ce..7df09612c75 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-17/neg/2.1.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-17/neg/2.1.fir.kt @@ -17,7 +17,7 @@ operator fun I2.invoke(): String = TODO() fun case1(a: A) { a.invoke() a() - A()() + A()() } // FILE: TestCase2.kt @@ -36,7 +36,7 @@ fun case1(a: I) { a.invoke() a() - val x = object : I {} () + val x = object : I {} () } // FILE: TestCase3.kt @@ -56,5 +56,5 @@ fun case1(a: I) { a.invoke{} a{} - val x = object : I {} {} + val x = object : I {} {} } 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-17/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-17/neg/2.2.fir.kt index d29f42599bf..9b65fd3866a 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-17/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-17/neg/2.2.fir.kt @@ -17,7 +17,7 @@ operator fun I2.invoke(): String = TODO() fun case1(a: A) { a.invoke() a() - A()() + A()() } // FILE: TestCase2.kt @@ -36,7 +36,7 @@ fun case1(a: I) { a.invoke() a() - val x = object : I {} () + val x = object : I {} () } // FILE: TestCase3.kt @@ -56,5 +56,5 @@ fun case1(a: I) { a.invoke{} a{} - val x = object : I {} {} + val x = object : I {} {} }