diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/Arguments.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/Arguments.kt index 04a5f69e9dd..d4ada8c462d 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/Arguments.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/Arguments.kt @@ -254,9 +254,7 @@ private fun checkApplicabilityForArgumentType( } if (!csBuilder.addSubtypeConstraintIfCompatible(argumentType, expectedType, position)) { if (!isReceiver) { - if (!csBuilder.addSubtypeConstraintIfCompatible(argumentType, nullableExpectedType, position)) { - csBuilder.addSubtypeConstraint(argumentType, expectedType, position) - } + csBuilder.addSubtypeConstraint(argumentType, expectedType, position) return } if (csBuilder.addSubtypeConstraintIfCompatible(argumentType, nullableExpectedType, position)) { diff --git a/compiler/fir/resolve/testData/resolve/stdlib/factoryFunctionOverloads.txt b/compiler/fir/resolve/testData/resolve/stdlib/factoryFunctionOverloads.txt index a57900b4a25..7af0e7fd8c6 100644 --- a/compiler/fir/resolve/testData/resolve/stdlib/factoryFunctionOverloads.txt +++ b/compiler/fir/resolve/testData/resolve/stdlib/factoryFunctionOverloads.txt @@ -27,5 +27,5 @@ FILE: factoryFunctionOverloads.kt public final fun foo(c: R|C|, b: R|B|, bn: R|B?|): R|kotlin/Unit| { lval x: R|A| = R|/A|(R|/c|) lval y: R|A| = R|/A.A|(R|/b|) - lval z: R|A| = R|/A.A|(R|/bn|) + lval z: R|A| = R|/A|(R|/bn|) } diff --git a/compiler/testData/diagnostics/tests/ExtensionCallInvoke.fir.kt b/compiler/testData/diagnostics/tests/ExtensionCallInvoke.fir.kt index 3a414132176..9e365c301f0 100644 --- a/compiler/testData/diagnostics/tests/ExtensionCallInvoke.fir.kt +++ b/compiler/testData/diagnostics/tests/ExtensionCallInvoke.fir.kt @@ -2,6 +2,6 @@ fun bar(doIt: Int.() -> Int) { 1.doIt() 1?.doIt() val i: Int? = 1 - i.doIt() + i.doIt() i?.doIt() } diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/genericFunctionsWithNullableTypes.fir.kt b/compiler/testData/diagnostics/tests/callableReference/generic/genericFunctionsWithNullableTypes.fir.kt index 33c47530fce..f5a10b2ed56 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/genericFunctionsWithNullableTypes.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/genericFunctionsWithNullableTypes.fir.kt @@ -23,8 +23,8 @@ fun test(x: T) { baz(null, null, ::foo) - baz(null, null, ::foo) - baz(null, null, ::foo) + baz(null, null, ::foo) + baz(null, null, ::foo) baz(null, "", ::foo) baz(1, null, ::foo) baz(null, null, ::foo) diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/AndOr.fir.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/AndOr.fir.kt index 90e0bb04051..77c6d0b1f6d 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/AndOr.fir.kt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/AndOr.fir.kt @@ -5,9 +5,9 @@ fun foo() { val x: Int? = null if (x != null && bar(x) == 0) bar(bar(x)) - bar(x) - if (x == null || bar(x) == 0) bar(bar(x)) - bar(x) + bar(x) + if (x == null || bar(x) == 0) bar(bar(x)) + bar(x) if (x is Int && bar(x)*bar(x) == bar(x)) bar(x) - bar(x) + bar(x) } diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/ArrayAccess.fir.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/ArrayAccess.fir.kt index cdf5521eaa1..acd4e6f6036 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/ArrayAccess.fir.kt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/ArrayAccess.fir.kt @@ -4,10 +4,10 @@ fun foo() { val x: Int? = null val a = Array(3, {0}) - if (x != null) bar(a[x]) else bar(a[x]) + if (x != null) bar(a[x]) else bar(a[x]) bar(a[if (x == null) 0 else x]) - bar(a[x]) + bar(a[x]) - "123"[x]; + "123"[x]; if (x != null) "123"[x]; } diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/BinaryExpression.fir.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/BinaryExpression.fir.kt index 1b8fe6d3ec4..8186fa93023 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/BinaryExpression.fir.kt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/BinaryExpression.fir.kt @@ -6,6 +6,6 @@ fun foo() { val x: Int? = null bar(1 + (if (x == null) 0 else x)) - bar(if (x == null) x else x) + bar(if (x == null) x else x) if (x != null) bar(x + x/(x-x*x)) } diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/DeepIf.fir.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/DeepIf.fir.kt index 2e9264619c7..f9453268461 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/DeepIf.fir.kt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/DeepIf.fir.kt @@ -17,14 +17,14 @@ fun foo() { if (x == null) bar(x) else bar(x) bar(bar(x)) } else if (x == null) { - bar(x) + bar(x) if (x != null) { bar(x) if (x == null) bar(x) if (x == null) bar(x) else bar(x) bar(bar(x) + bar(x)) } else if (x == null) { - bar(x) + bar(x) } } diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/DoWhile.fir.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/DoWhile.fir.kt index 0bbb351fb40..6f47bde260d 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/DoWhile.fir.kt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/DoWhile.fir.kt @@ -4,13 +4,13 @@ fun foo() { val x: Int? = null do { - bar(x) + bar(x) } while (x == null) bar(x) val y: Int? = null do { - bar(y) + bar(y) } while (y != null) - bar(y) + bar(y) } diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/DoWhileCondition.fir.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/DoWhileCondition.fir.kt index 6013fd34399..86b63f4d258 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/DoWhileCondition.fir.kt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/DoWhileCondition.fir.kt @@ -16,5 +16,5 @@ fun doWhileWithBreak(x: Int?, y0: Int) { y++ if (y > 0) break } while (x!! == y) - checkSubtype(x) + checkSubtype(x) } diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/Elvis.fir.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/Elvis.fir.kt index 02bcd2bcdc6..f7042dc5e38 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/Elvis.fir.kt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/Elvis.fir.kt @@ -5,5 +5,5 @@ fun foo() { bar(x ?: 0) if (x != null) bar(x ?: x) - bar(x) + bar(x) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/ExclExcl.fir.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/ExclExcl.fir.kt index 9d53b6c0473..6280b743bfc 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/ExclExcl.fir.kt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/ExclExcl.fir.kt @@ -1,7 +1,7 @@ fun bar(x: Int) = x + 1 fun f1(x: Int?) { - bar(x) + bar(x) if (x != null) bar(x!!) if (x == null) bar(x!!) } diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/For.fir.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/For.fir.kt index 28b3d130b89..5463fe9bafe 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/For.fir.kt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/For.fir.kt @@ -5,7 +5,7 @@ fun foo() { val a = Array(3, {0}) for (p in a) { - bar(x) + bar(x) if (x == null) continue bar(x) for (q in a) { @@ -15,7 +15,7 @@ fun foo() { } for (p in a) { - bar(x) + bar(x) if (x == null) break bar(x) } diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/FunctionLiteral.fir.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/FunctionLiteral.fir.kt index 1fc2dfb71ac..9b732f1e2ab 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/FunctionLiteral.fir.kt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/FunctionLiteral.fir.kt @@ -3,7 +3,7 @@ fun bar(x: Int) = x + 1 fun foo() { val x: Int? = null - fun baz() = bar(x) + fun baz() = bar(x) fun quux() = if (x != null) bar(x) else baz() fun quuux() = bar(if (x == null) 0 else x) } diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/IfStatement.fir.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/IfStatement.fir.kt index ef88daf14ae..a3e32d13887 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/IfStatement.fir.kt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/IfStatement.fir.kt @@ -25,7 +25,7 @@ fun ifThenElse(x: Int?) { fun ifIs(x: Int?, cond: Boolean) { if ((x is Int) == cond) { - checkSubtype(x) + checkSubtype(x) } - checkSubtype(x) + checkSubtype(x) } diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/IfThenElse.fir.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/IfThenElse.fir.kt index be811fb9c40..a5c46064d8c 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/IfThenElse.fir.kt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/IfThenElse.fir.kt @@ -6,7 +6,7 @@ fun foo() { bar(if (x == null) 0 else x) if (x == null) { - bar(x) + bar(x) return } else { bar(x) @@ -17,14 +17,14 @@ fun foo() { if (y is Int) { bar(y) } else { - bar(y) + bar(y) return } bar(y) val z: Int? = null if (z != null) bar(z) - bar(z) + bar(z) bar(z!!) if (z != null) bar(z!!) } diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/IfThenElseBothInvalid.fir.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/IfThenElseBothInvalid.fir.kt index 94aaf079517..148d614d6da 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/IfThenElseBothInvalid.fir.kt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/IfThenElseBothInvalid.fir.kt @@ -3,7 +3,7 @@ fun bar(x: Int): Int = x + 1 fun foo() { val x: Int? = null - bar(x) + bar(x) if (x != 2) { if (x == null) return 2+ diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/QualifiedExpression.fir.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/QualifiedExpression.fir.kt index 81eddacff27..7882754d287 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/QualifiedExpression.fir.kt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/QualifiedExpression.fir.kt @@ -7,7 +7,7 @@ class A { fun foo() { val x: Int? = null - A().bar(x) + A().bar(x) if (x == null) return A().bar(x) } diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/Return.fir.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/Return.fir.kt index 7165f3c6a56..27dac386db6 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/Return.fir.kt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/Return.fir.kt @@ -5,7 +5,7 @@ fun bar(x: Int): Int = x + 1 fun foo(): Int { val x: Int? = null - bar(x) + bar(x) if (x != null) return x val y: Int? = null diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/ThisSuper.fir.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/ThisSuper.fir.kt index 1d4dedb550e..346b7ed6ed9 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/ThisSuper.fir.kt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/ThisSuper.fir.kt @@ -8,14 +8,14 @@ class Derived : Base() { fun foo() { val x: Int? = null - super.bar(x) - this.baz(x) + super.bar(x) + this.baz(x) if (x == null) return super.bar(x) this.baz(x) val y: Int? = null if (y != null) super.bar(this.baz(y)) - else this.baz(super.bar(y)) + else this.baz(super.bar(y)) } } diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/Throw.fir.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/Throw.fir.kt index ffe940b64d7..49c3f665296 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/Throw.fir.kt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/Throw.fir.kt @@ -3,7 +3,7 @@ fun bar(x: Int): RuntimeException = RuntimeException(x.toString()) fun foo() { val x: Int? = null - if (x == null) throw bar(x) + if (x == null) throw bar(x) throw bar(x) throw bar(x) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/TryCatch.fir.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/TryCatch.fir.kt index 48bcd7fe2aa..a58338d2cbd 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/TryCatch.fir.kt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/TryCatch.fir.kt @@ -3,7 +3,7 @@ fun bar(x: Int): Int = x + 1 fun foo() { val x: Int? = null - bar(x) + bar(x) if (x == null) return try { bar(x) diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/While.fir.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/While.fir.kt index 1a78dde9378..495feeb6f45 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/While.fir.kt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/While.fir.kt @@ -3,7 +3,7 @@ fun bar(x: Int): Int = x + 1 fun foo() { val x: Int? = null while (x == null) { - bar(x) + bar(x) } bar(x) @@ -15,8 +15,8 @@ fun foo() { val z: Int? = null while (z == null) { - bar(z) + bar(z) break } - bar(z) + bar(z) } diff --git a/compiler/testData/diagnostics/tests/extensions/kt1875.fir.kt b/compiler/testData/diagnostics/tests/extensions/kt1875.fir.kt index d96ef602126..dba11ad9cc2 100644 --- a/compiler/testData/diagnostics/tests/extensions/kt1875.fir.kt +++ b/compiler/testData/diagnostics/tests/extensions/kt1875.fir.kt @@ -3,7 +3,7 @@ package kt1875 -fun foo(a : Int?, b : Int.(Int)->Int) = a?.b(1) //unnecessary safe call warning +fun foo(a : Int?, b : Int.(Int)->Int) = a?.b(1) //unnecessary safe call warning interface T { val f : ((i: Int) -> Unit)? diff --git a/compiler/testData/diagnostics/tests/generics/nullability/expressionsBoundsViolation.fir.kt b/compiler/testData/diagnostics/tests/generics/nullability/expressionsBoundsViolation.fir.kt index 1575e634da8..03e3a5d44db 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/expressionsBoundsViolation.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/nullability/expressionsBoundsViolation.fir.kt @@ -7,10 +7,10 @@ fun foo1(x: E) {} fun E.foo2() {} fun bar(x: F) { - A(x) + A(x) A(x) - foo1(x) + foo1(x) foo1(x) x.foo2() diff --git a/compiler/testData/diagnostics/tests/generics/nullability/functionalBound.fir.kt b/compiler/testData/diagnostics/tests/generics/nullability/functionalBound.fir.kt index 24faa0a169e..b6286cdd509 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/functionalBound.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/nullability/functionalBound.fir.kt @@ -5,7 +5,7 @@ fun Unit)?> foo(x: E, y: T) { } if (y != null) { - y(x) + y(x) } if (x != null && y != null) { diff --git a/compiler/testData/diagnostics/tests/generics/nullability/nullToGeneric.fir.kt b/compiler/testData/diagnostics/tests/generics/nullability/nullToGeneric.fir.kt index 09fe0b3722a..3cba1b9f73f 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/nullToGeneric.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/nullability/nullToGeneric.fir.kt @@ -6,7 +6,7 @@ fun foo(): T { val x1: T = null val x2: T? = null - bar(null) + bar(null) bar(null) return null @@ -23,7 +23,7 @@ class A { val x1: F = null val x2: F? = null - xyz(null) + xyz(null) bar(null) return null diff --git a/compiler/testData/diagnostics/tests/generics/nullability/tpBoundsViolation.fir.kt b/compiler/testData/diagnostics/tests/generics/nullability/tpBoundsViolation.fir.kt index 0f97d2ba9e1..a9741f314d2 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/tpBoundsViolation.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/nullability/tpBoundsViolation.fir.kt @@ -18,14 +18,14 @@ class A { x2.checkType { _() } foo1(y) - foo1(y) + foo1(y) foo2(y) val x3 = foo2(y) x3.checkType { _() } - foo1(y) - foo2(y) + foo1(y) + foo2(y) foo1(z) @@ -38,7 +38,7 @@ class A { x4.checkType { _() } foo1(w) - foo1(w) + foo1(w) foo2(w) val x6 = foo2(w) diff --git a/compiler/testData/diagnostics/tests/generics/nullability/useAsValueArgument.fir.kt b/compiler/testData/diagnostics/tests/generics/nullability/useAsValueArgument.fir.kt index 3f2568af980..5cb21bcd5fb 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/useAsValueArgument.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/nullability/useAsValueArgument.fir.kt @@ -13,6 +13,6 @@ fun foo(x: T) { bar1(x) bar2(x) - bar3(x) - bar4(x) + bar3(x) + bar4(x) } diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/starNullability.fir.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/starNullability.fir.kt index 26ff7f50583..a7fe4f6edc3 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/starNullability.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/starNullability.fir.kt @@ -12,5 +12,5 @@ fun acceptA(a: A) { fun main(i: I<*>) { i.foo() checkType { _() } - acceptA(i.foo()) // i.foo() should be nullable but isn't + acceptA(i.foo()) // i.foo() should be nullable but isn't } diff --git a/compiler/testData/diagnostics/tests/incompleteCode/checkNothingIsSubtype.fir.kt b/compiler/testData/diagnostics/tests/incompleteCode/checkNothingIsSubtype.fir.kt index 6a13250ac61..fbbf473506b 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/checkNothingIsSubtype.fir.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/checkNothingIsSubtype.fir.kt @@ -7,7 +7,7 @@ interface A fun infer(a: A) : T {} fun test(nothing: Nothing?) { - val i = infer(nothing) + val i = infer(nothing) } fun sum(a : IntArray) : Int { diff --git a/compiler/testData/diagnostics/tests/inference/kt1293.fir.kt b/compiler/testData/diagnostics/tests/inference/kt1293.fir.kt index 17db113b303..a16738e4f05 100644 --- a/compiler/testData/diagnostics/tests/inference/kt1293.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/kt1293.fir.kt @@ -6,7 +6,7 @@ package kt1293 fun main() { val intArray = arrayOfNulls(10) val i : Int = intArray[0] - requiresInt(intArray[0]) + requiresInt(intArray[0]) } fun requiresInt(i: Int) {} diff --git a/compiler/testData/diagnostics/tests/inference/nestedCalls/kt3461checkTypes.fir.kt b/compiler/testData/diagnostics/tests/inference/nestedCalls/kt3461checkTypes.fir.kt index ec9c0298aeb..a3edf6a5978 100644 --- a/compiler/testData/diagnostics/tests/inference/nestedCalls/kt3461checkTypes.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/nestedCalls/kt3461checkTypes.fir.kt @@ -10,6 +10,6 @@ fun foo(s: String) {} fun r(): Int? = null fun test() { - foo(F().p()) + foo(F().p()) foo(r()) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2838.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2838.fir.kt index 8d580c9bef0..45478c1fbf0 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2838.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2838.fir.kt @@ -8,7 +8,7 @@ fun bar(a: T, b: Map) = b.get(a) fun test(a: Int) { foo(a, null) - bar(a, null) + bar(a, null) } fun test1(a: Int) { foo(a, throw Exception()) diff --git a/compiler/testData/diagnostics/tests/j+k/SupertypeArgumentsNullability-NotNull-SpecialTypes.fir.kt b/compiler/testData/diagnostics/tests/j+k/SupertypeArgumentsNullability-NotNull-SpecialTypes.fir.kt index 842a06b0502..9492d128b0a 100644 --- a/compiler/testData/diagnostics/tests/j+k/SupertypeArgumentsNullability-NotNull-SpecialTypes.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/SupertypeArgumentsNullability-NotNull-SpecialTypes.fir.kt @@ -19,5 +19,5 @@ public class Y extends X { fun main() { checkSubtype(Y().fooN()) - Y().barN(null); + Y().barN(null); } diff --git a/compiler/testData/diagnostics/tests/j+k/SupertypeArgumentsNullability-NotNull-UserTypes.fir.kt b/compiler/testData/diagnostics/tests/j+k/SupertypeArgumentsNullability-NotNull-UserTypes.fir.kt index 610836c63f5..49780d0e7e3 100644 --- a/compiler/testData/diagnostics/tests/j+k/SupertypeArgumentsNullability-NotNull-UserTypes.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/SupertypeArgumentsNullability-NotNull-UserTypes.fir.kt @@ -19,5 +19,5 @@ public class Y extends X { fun main() { checkSubtype(Y().fooN()) - Y().barN(null); + Y().barN(null); } diff --git a/compiler/testData/diagnostics/tests/j+k/primitiveOverrides/specializedMap.fir.kt b/compiler/testData/diagnostics/tests/j+k/primitiveOverrides/specializedMap.fir.kt index dad78e433d0..bf6ee149928 100644 --- a/compiler/testData/diagnostics/tests/j+k/primitiveOverrides/specializedMap.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/primitiveOverrides/specializedMap.fir.kt @@ -109,5 +109,5 @@ fun foo(x: SpecializedMap) { x.remove(null) x.put(4, 5.0) - x.put(4, null) + x.put(4, null) } diff --git a/compiler/testData/diagnostics/tests/j+k/wrongVarianceInJava.fir.kt b/compiler/testData/diagnostics/tests/j+k/wrongVarianceInJava.fir.kt index f9f04ca3148..9d6c3b79428 100644 --- a/compiler/testData/diagnostics/tests/j+k/wrongVarianceInJava.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/wrongVarianceInJava.fir.kt @@ -20,5 +20,5 @@ class In { fun test() { A.foo().x() checkType { _() } - A.bar().y(null) + A.bar().y(null) } diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/QualifiedExpressionNullability.fir.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/QualifiedExpressionNullability.fir.kt index 0444e2a1c20..dd37e99af1e 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/QualifiedExpressionNullability.fir.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/QualifiedExpressionNullability.fir.kt @@ -8,7 +8,7 @@ fun main() { val y: Foo? = null x.foo(y) - x!!.foo(y) + x!!.foo(y) x.foo(y!!) x!!.foo(y!!) @@ -18,8 +18,8 @@ fun main() { a.foo(b.foo(c)) a!!.foo(b.foo(c)) - a.foo(b!!.foo(c)) - a!!.foo(b!!.foo(c)) + a.foo(b!!.foo(c)) + a!!.foo(b!!.foo(c)) a.foo(b.foo(c!!)) a!!.foo(b.foo(c!!)) a.foo(b!!.foo(c!!)) diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2164.fir.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2164.fir.kt index b11da4a5726..f8234379d56 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2164.fir.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2164.fir.kt @@ -7,7 +7,7 @@ fun foo(x: Int): Int = x + 1 fun main() { val x: Int? = null - foo(x) + foo(x) if (x != null) { foo(x) @@ -15,14 +15,14 @@ fun main() { foo(x) } - foo(x) + foo(x) if (x != null) { foo(x) foo(x!!) foo(x) } else { - foo(x) + foo(x) foo(x!!) foo(x) } diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2216.fir.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2216.fir.kt index efc455e8dc3..673aa7e412a 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2216.fir.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2216.fir.kt @@ -15,8 +15,8 @@ fun foo() { val y: Int? = 0 val z: Int? = 0 - bar(if (y != null) y else z, y) + bar(if (y != null) y else z, y) y + 2 - baz(y, y, if (y == null) return else y, y) + baz(y, y, if (y == null) return else y, y) baz(y, z!!, z, y) } diff --git a/compiler/testData/diagnostics/tests/nullableTypes/nullableArgumentForIn.fir.kt b/compiler/testData/diagnostics/tests/nullableTypes/nullableArgumentForIn.fir.kt index 8adfaa1fcd8..6adf2af7c53 100644 --- a/compiler/testData/diagnostics/tests/nullableTypes/nullableArgumentForIn.fir.kt +++ b/compiler/testData/diagnostics/tests/nullableTypes/nullableArgumentForIn.fir.kt @@ -1,3 +1,3 @@ fun test(x: Int?) { - x in 1..2 + x in 1..2 } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/nullableTypes/nullableArgumentToNonNullParameterPlatform.fir.kt b/compiler/testData/diagnostics/tests/nullableTypes/nullableArgumentToNonNullParameterPlatform.fir.kt index 2ef99b24447..f4f557da92c 100644 --- a/compiler/testData/diagnostics/tests/nullableTypes/nullableArgumentToNonNullParameterPlatform.fir.kt +++ b/compiler/testData/diagnostics/tests/nullableTypes/nullableArgumentToNonNullParameterPlatform.fir.kt @@ -13,6 +13,6 @@ public class J { fun test(j: J, nullStr: String?, nullByte: Byte?, nullDouble: Double?) { j.foo(nullStr) - j.foo(nullDouble) + j.foo(nullDouble) j.foo(nullByte) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/nullableTypes/nullableArgumentToNonNullParameterSimple.fir.kt b/compiler/testData/diagnostics/tests/nullableTypes/nullableArgumentToNonNullParameterSimple.fir.kt index af6e1aea464..02eb22e893e 100644 --- a/compiler/testData/diagnostics/tests/nullableTypes/nullableArgumentToNonNullParameterSimple.fir.kt +++ b/compiler/testData/diagnostics/tests/nullableTypes/nullableArgumentToNonNullParameterSimple.fir.kt @@ -6,8 +6,8 @@ fun foo(x: Int) {} fun foo(x: Int, y: String) {} fun bar(nullX: Int?, nullY: String?, notNullY: String) { - foo(nullX) - foo(nullX, notNullY) - foo(nullX, nullY) + foo(nullX) + foo(nullX, notNullY) + foo(nullX, nullY) foo() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/nullableTypes/safeCallWithInvoke.fir.kt b/compiler/testData/diagnostics/tests/nullableTypes/safeCallWithInvoke.fir.kt index feb936e7966..b3eadb00e43 100644 --- a/compiler/testData/diagnostics/tests/nullableTypes/safeCallWithInvoke.fir.kt +++ b/compiler/testData/diagnostics/tests/nullableTypes/safeCallWithInvoke.fir.kt @@ -8,5 +8,5 @@ fun foo(i: Int) = i fun test(a: A?) { a?.b(1) //should be no warning - foo(a?.b(1)) //no warning, only error + foo(a?.b(1)) //no warning, only error } diff --git a/compiler/testData/diagnostics/tests/platformTypes/intVsIntegerAmbiguity.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/intVsIntegerAmbiguity.fir.kt index 0e13d7b542d..3eb86c36c4b 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/intVsIntegerAmbiguity.fir.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/intVsIntegerAmbiguity.fir.kt @@ -27,9 +27,9 @@ fun test(i: Int, ni: Int?) { checkSubtype(foo(2)) checkSubtype(J.foo(2)) checkSubtype(J.foo(i)) - checkSubtype(J.foo(ni)) + checkSubtype(J.foo(ni)) checkSubtype(foo(ni)) - checkSubtype(J.foo(ni)) + checkSubtype(J.foo(ni)) foo(J.getInteger()) J.foo(J.getInteger()) diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/int.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/int.fir.kt index cfcf3e01468..01b8afecf1b 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/int.fir.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/methodCall/int.fir.kt @@ -12,5 +12,5 @@ import p.* fun test() { J()._int(1) - J()._int(null) + J()._int(null) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/notNullTypeParameter/methodTypeParameter.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/notNullTypeParameter/methodTypeParameter.fir.kt index 689e6e31ab5..81e9a73bf91 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/notNullTypeParameter/methodTypeParameter.fir.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/notNullTypeParameter/methodTypeParameter.fir.kt @@ -13,7 +13,7 @@ public class A { fun test() { A.bar(null, "") - A.bar(null, "") + A.bar(null, "") A.bar(null, "") A.bar(null, A.platformString()) } diff --git a/compiler/testData/diagnostics/tests/platformTypes/notNullTypeParameter/noInheritanceValueParameter.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/notNullTypeParameter/noInheritanceValueParameter.fir.kt index 833b6ecaab4..a0599c7d3c1 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/notNullTypeParameter/noInheritanceValueParameter.fir.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/notNullTypeParameter/noInheritanceValueParameter.fir.kt @@ -17,10 +17,10 @@ public class A { // FILE: k.kt fun test() { - A.create().bar(null) + A.create().bar(null) A.create().bar("") - A().bar(null) - A().bar(null) + A().bar(null) + A().bar(null) A().bar("") } diff --git a/compiler/testData/diagnostics/tests/platformTypes/notNullTypeParameter/substitutionInSuperType.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/notNullTypeParameter/substitutionInSuperType.fir.kt index b40ce52152f..011ed315190 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/notNullTypeParameter/substitutionInSuperType.fir.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/notNullTypeParameter/substitutionInSuperType.fir.kt @@ -33,9 +33,9 @@ class C2 : A() { } fun test() { - B1().bar(null) - B2().bar(null) + B1().bar(null) + B2().bar(null) - C1().bar(null) + C1().bar(null) } diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/arithmetic.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/arithmetic.fir.kt index 2207ca812c9..daa58e6d862 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/arithmetic.fir.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/arithmetic.fir.kt @@ -34,7 +34,7 @@ fun test() { platformJ++ 1 + platformNN - 1 + platformN + 1 + platformN 1 + platformJ platformNN + 1 @@ -42,7 +42,7 @@ fun test() { platformJ + 1 1 plus platformNN - 1 plus platformN + 1 plus platformN 1 plus platformJ platformNN plus 1 diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/dataFlowInfo.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/dataFlowInfo.fir.kt index 83f6b64ec77..c9275ffedc1 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/dataFlowInfo.fir.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/dataFlowInfo.fir.kt @@ -15,7 +15,7 @@ public class J { fun test() { val n = J.staticN - foo(n) + foo(n) J.staticNN = n if (n != null) { foo(n) diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/expectedType.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/expectedType.fir.kt index 4cb1e8e3926..e276ae877b4 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/expectedType.fir.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/expectedType.fir.kt @@ -23,7 +23,7 @@ fun test() { val platformJ = J.staticJ checkSubtype(platformNN) - checkSubtype(platformN) + checkSubtype(platformN) checkSubtype(platformJ) checkSubtype(platformNN) diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/functionArguments.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/functionArguments.fir.kt index 981585397c1..c3324690eea 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/functionArguments.fir.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/functionArguments.fir.kt @@ -15,7 +15,7 @@ public class J { fun test() { foo(J.staticNN) - foo(J.staticN) + foo(J.staticN) foo(J.staticJ) bar(J.staticNN) diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/passToJava.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/passToJava.fir.kt index 280455894df..86f49b1f8d2 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/passToJava.fir.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/passToJava.fir.kt @@ -54,8 +54,8 @@ fun test(n: J?, nn: J) { J.staticSet(nn, nn, nn) J.staticSet(platformNN, platformNN, platformNN) - J.staticSet(n, n, n) - J.staticSet(platformN, platformN, platformN) + J.staticSet(n, n, n) + J.staticSet(platformN, platformN, platformN) J.staticSet(platformJ, platformJ, platformJ) J().nn = n @@ -78,13 +78,13 @@ fun test(n: J?, nn: J) { J().set(nn, nn, nn) J().set(platformNN, platformNN, platformNN) - J().set(n, n, n) - J().set(platformN, platformN, platformN) + J().set(n, n, n) + J().set(platformN, platformN, platformN) J().set(platformJ, platformJ, platformJ) J(nn, nn, nn) J(platformNN, platformNN, platformNN) - J(n, n, n) - J(platformN, platformN, platformN) + J(n, n, n) + J(platformN, platformN, platformN) J(platformJ, platformJ, platformJ) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/typeEnhancement/overriddenExtensions.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/typeEnhancement/overriddenExtensions.fir.kt index fe29fe38d9e..b341e6fcf69 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/typeEnhancement/overriddenExtensions.fir.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/typeEnhancement/overriddenExtensions.fir.kt @@ -10,7 +10,7 @@ class E : B1() { x.foo(x) x.foo("") - x.bar(x) + x.bar(x) x.bar("") } diff --git a/compiler/testData/diagnostics/tests/regressions/kt1489_1728.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt1489_1728.fir.kt index 8ce7619d2f4..cf2fd9afae7 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt1489_1728.fir.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt1489_1728.fir.kt @@ -19,7 +19,7 @@ class C { fun p() : Resource? = null fun bar() { - foo(p()) { + foo(p()) { } } diff --git a/compiler/testData/diagnostics/tests/resolve/nestedCalls/kt5971NestedSafeCall.fir.kt b/compiler/testData/diagnostics/tests/resolve/nestedCalls/kt5971NestedSafeCall.fir.kt index 48e34c01f67..0acde4900a5 100644 --- a/compiler/testData/diagnostics/tests/resolve/nestedCalls/kt5971NestedSafeCall.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/nestedCalls/kt5971NestedSafeCall.fir.kt @@ -5,5 +5,5 @@ fun foo(i: Int) {} fun test(s: String?) { - foo(s?.length) + foo(s?.length) } diff --git a/compiler/testData/diagnostics/tests/resolve/specialConstructions/reportTypeMismatchDeeplyOnBranches.fir.kt b/compiler/testData/diagnostics/tests/resolve/specialConstructions/reportTypeMismatchDeeplyOnBranches.fir.kt index 05be2916b0c..a7a9efbbcb3 100644 --- a/compiler/testData/diagnostics/tests/resolve/specialConstructions/reportTypeMismatchDeeplyOnBranches.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/specialConstructions/reportTypeMismatchDeeplyOnBranches.fir.kt @@ -4,19 +4,19 @@ package b fun bar(i: Int) = i fun test(a: Int?, b: Int?) { - bar(if (a == null) return else b) + bar(if (a == null) return else b) } fun test(a: Int?, b: Int?, c: Int?) { - bar(if (a == null) return else if (b == null) return else c) + bar(if (a == null) return else if (b == null) return else c) } fun test(a: Any?, b: Any?, c: Int?) { - bar(if (a == null) if (b == null) c else return else return) + bar(if (a == null) if (b == null) c else return else return) } fun test(a: Int?, b: Any?, c: Int?) { - bar(if (a == null) { + bar(if (a == null) { return } else { if (b == null) { diff --git a/compiler/testData/diagnostics/tests/smartCasts/classObjectMember.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/classObjectMember.fir.kt index 179c6e4cb9c..48a44761283 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/classObjectMember.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/classObjectMember.fir.kt @@ -15,7 +15,7 @@ class B { fun test() { if (A.x != null) { useInt(A.x) - useInt(B.x) + useInt(B.x) } } diff --git a/compiler/testData/diagnostics/tests/smartCasts/elvisExclExclPlatform.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/elvisExclExclPlatform.fir.kt index 52d8720b9af..fe045272d63 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/elvisExclExclPlatform.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/elvisExclExclPlatform.fir.kt @@ -19,7 +19,7 @@ fun bar(x: String) = x fun test(x: String?): Any { val y = My.create() val z = x ?: y!! - bar(y) + bar(y) // !! / ?. is necessary here, because y!! above may not be executed y?.hashCode() y!!.hashCode() diff --git a/compiler/testData/diagnostics/tests/smartCasts/kt2422.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/kt2422.fir.kt index 09602746baa..6040b1460de 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/kt2422.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/kt2422.fir.kt @@ -6,10 +6,10 @@ class Test { fun bar(a: Test, b: Test) { if (a.foo != null) { - useInt(b.foo) + useInt(b.foo) } if (a.foo != null) { - useInt(foo) + useInt(foo) } if (this.foo != null) { useInt(foo) diff --git a/compiler/testData/diagnostics/tests/smartCasts/kt2865.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/kt2865.fir.kt index aa67f2a7f65..fe9fae8146d 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/kt2865.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/kt2865.fir.kt @@ -7,6 +7,6 @@ fun foo(a: MutableMap, x: String?) { } fun foo1(a: MutableMap, x: String?) { - a[x] = x!! + a[x] = x!! a[x!!] = x } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/noErrorCheckForPackageLevelVal.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/noErrorCheckForPackageLevelVal.fir.kt index 4cba8e94eee..c24ca8ed274 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/noErrorCheckForPackageLevelVal.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/noErrorCheckForPackageLevelVal.fir.kt @@ -11,14 +11,14 @@ val i: Int? = 1 class A(val i: Int?) { fun testUseFromClass() { if (foo.i != null) { - useInt(i) + useInt(i) } } } fun testUseFromOtherPackage() { if (bar.i != null) { - useInt(i) + useInt(i) } } diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/simpleNullableReceiver.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/simpleNullableReceiver.fir.kt index a829e21c633..fd23b53d520 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/simpleNullableReceiver.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/simpleNullableReceiver.fir.kt @@ -3,4 +3,4 @@ fun Any?.foo(my: My) = my === this class My(val x: Any) // my is nullable in brackets because Any?.foo has nullable receiver -fun foo(my: My?) = my?.x.foo(my) \ No newline at end of file +fun foo(my: My?) = my?.x.foo(my) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/variables/property.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/variables/property.fir.kt index 85c74542a9f..8951d31bf6f 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/variables/property.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/variables/property.fir.kt @@ -7,5 +7,5 @@ fun bar(s: String): Int { fun foo(m: MyClass): Int { m.p = "xyz" - return bar(m.p) + return bar(m.p) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava.fir.kt index fe8193d4d92..87f6b599442 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava.fir.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava.fir.kt @@ -23,7 +23,7 @@ fun foo(k: KotlinClass) { k.setSomething4("") k.something4 += "" - k.setSomething4(null) + k.setSomething4(null) k.something4 = null useString(k.getSomething5()) diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/ParameterTypeAnnotation.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/ParameterTypeAnnotation.fir.kt index eece4ba7e9e..a800a633332 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/ParameterTypeAnnotation.fir.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/ParameterTypeAnnotation.fir.kt @@ -1,8 +1,8 @@ // !WITH_NEW_INFERENCE // FILE: KotlinFile.kt fun foo(javaInterface: JavaInterface) { - javaInterface.doIt(null) { } - javaInterface.doIt("", null) + javaInterface.doIt(null) { } + javaInterface.doIt("", null) } // FILE: JavaInterface.java diff --git a/compiler/testData/diagnostics/tests/targetedBuiltIns/forEachRemainingNullability.fir.kt b/compiler/testData/diagnostics/tests/targetedBuiltIns/forEachRemainingNullability.fir.kt index fb54c047784..de1fde585d4 100644 --- a/compiler/testData/diagnostics/tests/targetedBuiltIns/forEachRemainingNullability.fir.kt +++ b/compiler/testData/diagnostics/tests/targetedBuiltIns/forEachRemainingNullability.fir.kt @@ -32,7 +32,7 @@ abstract class MyIt7 : Iterator { fun foo(x: Iterator, y: Iterator) { - x.forEachRemaining(null) + x.forEachRemaining(null) x.forEachRemaining { it -> it.length } x.forEachRemaining { it -> it?.length } diff --git a/compiler/testData/diagnostics/tests/targetedBuiltIns/mutableMapRemove.fir.kt b/compiler/testData/diagnostics/tests/targetedBuiltIns/mutableMapRemove.fir.kt index 3f37343499b..8936f1b8963 100644 --- a/compiler/testData/diagnostics/tests/targetedBuiltIns/mutableMapRemove.fir.kt +++ b/compiler/testData/diagnostics/tests/targetedBuiltIns/mutableMapRemove.fir.kt @@ -19,7 +19,7 @@ class KotlinMap2 : java.util.AbstractMap() { fun foo(x: MutableMap, y: java.util.HashMap, z: java.util.AbstractMap) { x.remove("", 1) x.remove("", "") - x.remove("", null) + x.remove("", null) y.remove("", 1) y.remove("", "") diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInference.fir.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInference.fir.kt index ce8525c055c..ec5a2863b61 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInference.fir.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInference.fir.kt @@ -21,7 +21,7 @@ class Pair(val x: X, val y: Y) typealias PL = Pair> typealias PN = Pair> -val test5 = PL(1, null) +val test5 = PL(1, null) class Foo(val p: Pair) diff --git a/compiler/testData/diagnostics/tests/varargs/NullableTypeForVarargArgument.fir.kt b/compiler/testData/diagnostics/tests/varargs/NullableTypeForVarargArgument.fir.kt index 458239df8a4..af729da9c91 100644 --- a/compiler/testData/diagnostics/tests/varargs/NullableTypeForVarargArgument.fir.kt +++ b/compiler/testData/diagnostics/tests/varargs/NullableTypeForVarargArgument.fir.kt @@ -31,7 +31,7 @@ fun getArr(): Array? = null fun f() { A().foo(1, *args) - bar(2, *args) + bar(2, *args) baz(*args) } @@ -55,7 +55,7 @@ fun h(b: B) { fun k() { A().foo(1, *getArr()) - bar(2, *getArr()) + bar(2, *getArr()) baz(*getArr()) } diff --git a/compiler/testData/diagnostics/testsWithStdLib/java/functionN.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/java/functionN.fir.kt index 428ca22b761..6f3227c76ac 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/java/functionN.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/java/functionN.fir.kt @@ -46,7 +46,7 @@ fun main() { a.bar() a.baz(listOf()) - a.manyParams(null) + a.manyParams(null) a.manyParams(any>()) // Potentially, this would have better to forbid calling manyParams, too. diff --git a/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/arrayList.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/arrayList.fir.kt index b2f9ec43367..a8dd30d7c19 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/arrayList.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/arrayList.fir.kt @@ -6,12 +6,12 @@ fun bar(): String? = null fun foo() { var x = ArrayList() - x.add(null) - x.add(bar()) + x.add(null) + x.add(bar()) x.add("") - x[0] = null - x[0] = bar() + x[0] = null + x[0] = bar() x[0] = "" val b1: MutableList = x diff --git a/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/customClassMutableCollection.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/customClassMutableCollection.fir.kt index 5bedf9d6c26..2891074371e 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/customClassMutableCollection.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/customClassMutableCollection.fir.kt @@ -24,8 +24,8 @@ fun bar(): String? = null fun foo() { var x = A() - x.add(null) - x.add(bar()) + x.add(null) + x.add(bar()) x.add("") val b1: Collection = x diff --git a/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/customClassMutableList.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/customClassMutableList.fir.kt index 6a4b798bea1..c04bf55ab36 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/customClassMutableList.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/customClassMutableList.fir.kt @@ -24,12 +24,12 @@ fun bar(): String? = null fun foo() { var x = A() - x.add(null) - x.add(bar()) + x.add(null) + x.add(bar()) x.add("") - x[0] = null - x[0] = bar() + x[0] = null + x[0] = bar() x[0] = "" val b1: MutableList = x diff --git a/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/maps.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/maps.fir.kt index 26697f2a424..3a7b4aa1b9e 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/maps.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/maps.fir.kt @@ -10,14 +10,14 @@ val nullableInt: Int? = null fun hashMapTest() { var x: HashMap = HashMap() - x.put(null, null) - x.put("", null) - x.put(bar(), 1) + x.put(null, null) + x.put("", null) + x.put(bar(), 1) x.put("", 1) - x[null] = 1 - x[bar()] = 1 - x[""] = nullableInt + x[null] = 1 + x[bar()] = 1 + x[""] = nullableInt x[""] = 1 val b1: MutableMap = x @@ -34,14 +34,14 @@ fun hashMapTest() { fun treeMapTest() { var x: TreeMap = TreeMap() - x.put(null, null) - x.put("", null) - x.put(bar(), 1) + x.put(null, null) + x.put("", null) + x.put(bar(), 1) x.put("", 1) - x[null] = 1 - x[bar()] = 1 - x[""] = nullableInt + x[null] = 1 + x[bar()] = 1 + x[""] = nullableInt x[""] = 1 val b1: MutableMap = x @@ -58,14 +58,14 @@ fun treeMapTest() { fun concurrentHashMapTest() { var x: ConcurrentHashMap = ConcurrentHashMap() - x.put(null, null) - x.put("", null) - x.put(bar(), 1) + x.put(null, null) + x.put("", null) + x.put(bar(), 1) x.put("", 1) - x[null] = 1 - x[bar()] = 1 - x[""] = nullableInt + x[null] = 1 + x[bar()] = 1 + x[""] = nullableInt x[""] = 1 val b1: MutableMap = x diff --git a/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/mapsWithNullableKey.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/mapsWithNullableKey.fir.kt index d139896edca..f39322c50c4 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/mapsWithNullableKey.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/mapsWithNullableKey.fir.kt @@ -9,14 +9,14 @@ val nullableInt: Int? = null fun hashMapTest() { var x: HashMap = HashMap() - x.put(null, null) - x.put("", null) + x.put(null, null) + x.put("", null) x.put(bar(), 1) x.put("", 1) x[null] = 1 x[bar()] = 1 - x[""] = nullableInt + x[""] = nullableInt x[""] = 1 val b1: MutableMap = x @@ -34,14 +34,14 @@ fun hashMapTest() { fun treeMapTest() { var x: TreeMap = TreeMap() - x.put(null, null) - x.put("", null) + x.put(null, null) + x.put("", null) x.put(bar(), 1) x.put("", 1) x[null] = 1 x[bar()] = 1 - x[""] = nullableInt + x[""] = nullableInt x[""] = 1 val b1: MutableMap = x diff --git a/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/mapsWithNullableValues.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/mapsWithNullableValues.fir.kt index f06efd6038e..0e8996e0df5 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/mapsWithNullableValues.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/mapsWithNullableValues.fir.kt @@ -9,13 +9,13 @@ val nullableInt: Int? = null fun hashMapTest() { var x: HashMap = HashMap() - x.put(null, null) + x.put(null, null) x.put("", null) - x.put(bar(), 1) + x.put(bar(), 1) x.put("", 1) - x[null] = 1 - x[bar()] = 1 + x[null] = 1 + x[bar()] = 1 x[""] = nullableInt x[""] = 1 @@ -33,13 +33,13 @@ fun hashMapTest() { fun treeMapTest() { var x: TreeMap = TreeMap() - x.put(null, null) + x.put(null, null) x.put("", null) - x.put(bar(), 1) + x.put(bar(), 1) x.put("", 1) - x[null] = 1 - x[bar()] = 1 + x[null] = 1 + x[bar()] = 1 x[""] = nullableInt x[""] = 1 diff --git a/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/sets.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/sets.fir.kt index b50262fefeb..8e7624771c9 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/sets.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/sets.fir.kt @@ -8,8 +8,8 @@ fun bar(): String? = null fun fooHashSet() { var x = HashSet() - x.add(null) - x.add(bar()) + x.add(null) + x.add(bar()) x.add("") val b1: MutableSet = x @@ -22,8 +22,8 @@ fun fooHashSet() { fun fooTreeSet() { var x = TreeSet() - x.add(null) - x.add(bar()) + x.add(null) + x.add(bar()) x.add("") val b1: MutableSet = x @@ -36,8 +36,8 @@ fun fooTreeSet() { fun fooLinkedHashSet() { var x = LinkedHashSet() - x.add(null) - x.add(bar()) + x.add(null) + x.add(bar()) x.add("") val b1: MutableSet = x diff --git a/compiler/testData/diagnostics/testsWithStdLib/regression/kt2082.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/regression/kt2082.fir.kt index 0548489ea06..fd5c1c83709 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/regression/kt2082.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/regression/kt2082.fir.kt @@ -2,7 +2,7 @@ fun foo(c : Collection) = { c.filter{ val s : String? = bar() if (s == null) false // here! - zoo(s) + zoo(s) } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/smartcasts/forEachUnsafe.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/smartcasts/forEachUnsafe.fir.kt index 2972e263e69..0f1c3381217 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/smartcasts/forEachUnsafe.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/smartcasts/forEachUnsafe.fir.kt @@ -3,7 +3,7 @@ fun indexOfMax(a: IntArray): Int? { var maxI: Int? = 0 a.forEachIndexed { i, value -> - if (value >= a[maxI]) { + if (value >= a[maxI]) { maxI = i } else if (value < 0) {