diff --git a/plugins/kotlin/idea/tests/testData/checker/ExtensionFunctions.kt b/plugins/kotlin/idea/tests/testData/checker/ExtensionFunctions.kt index 9573dd6c8465..a61578e44f2e 100644 --- a/plugins/kotlin/idea/tests/testData/checker/ExtensionFunctions.kt +++ b/plugins/kotlin/idea/tests/testData/checker/ExtensionFunctions.kt @@ -6,9 +6,7 @@ fun T.foo(?.minus(this) + this?.minus(this) return this } @@ -66,9 +64,7 @@ fun Int.foo() = this command?.equals1(null) val c = Command() - c?.equals2(null) + c?.equals2(null) if (command == null) 1 } diff --git a/plugins/kotlin/idea/tests/testData/checker/WhenNonExhaustive.kt b/plugins/kotlin/idea/tests/testData/checker/WhenNonExhaustive.kt index 88a3b9722ec6..0cdd5096584d 100644 --- a/plugins/kotlin/idea/tests/testData/checker/WhenNonExhaustive.kt +++ b/plugins/kotlin/idea/tests/testData/checker/WhenNonExhaustive.kt @@ -27,7 +27,7 @@ fun nonExhaustiveNullable(c: Color?) = when(c) { + when(c) { Color.BLUE -> {} Color.GREEN -> {} } @@ -60,6 +60,6 @@ fun nonExhaustiveNullableSealed(v: Variant?) = when(e) {} +fun nonExhaustiveEmpty(e: Empty) = when(e) {} -fun nonExhaustiveNullableEmpty(e: Empty?) = when(e) {} +fun nonExhaustiveNullableEmpty(e: Empty?) = when(e) {} diff --git a/plugins/kotlin/idea/tests/testData/checker/regression/SpecififcityByReceiver.kt b/plugins/kotlin/idea/tests/testData/checker/regression/SpecififcityByReceiver.kt index 4453bf61f3d9..1fac1837910b 100644 --- a/plugins/kotlin/idea/tests/testData/checker/regression/SpecififcityByReceiver.kt +++ b/plugins/kotlin/idea/tests/testData/checker/regression/SpecififcityByReceiver.kt @@ -6,8 +6,6 @@ fun main(args val command : Any = 1 - command?.equals(null) + command?.equals(null) command.equals(null) } diff --git a/plugins/kotlin/idea/tests/testData/inspections/cleanup/basic/basic.kt.after b/plugins/kotlin/idea/tests/testData/inspections/cleanup/basic/basic.kt.after index 293e00d7a58f..6a21aaeb5773 100644 --- a/plugins/kotlin/idea/tests/testData/inspections/cleanup/basic/basic.kt.after +++ b/plugins/kotlin/idea/tests/testData/inspections/cleanup/basic/basic.kt.after @@ -67,45 +67,44 @@ val x = C() willBeInfix 1 fun bar(yield: Int = 4) {} fun yield(yield: Int) { - "$`yield`" - "${`yield`}" + "$yield" + "${yield}" - `yield` - val foo = `yield` + `yield` - val foo2 = `yield` + yield + val foo = yield + yield + val foo2 = yield // bar(yield = 5) //this is different in old and new inference, should be tested in compiler yield(4) - yield() {} + yield {} - class yield> + class yield> - return@`yield` - return@`yield` Unit + return@yield + return@yield Unit - val foo5: `yield`<*> + val foo5: yield<*> } fun yield(i: (Int) -> Unit) {} annotation class yield -@`yield`() +@yield() fun test2(p: Int) { - `yield`@ p + yield@ p - @`yield` - fun f() {} + @yield fun f() {} } object X { fun yield() {} fun test3(yield: Int) { - X::`yield` + X::yield - `yield`::toInt + yield::toInt } } diff --git a/plugins/kotlin/idea/tests/testData/inspections/dfa/InlineLambda.kt b/plugins/kotlin/idea/tests/testData/inspections/dfa/InlineLambda.kt index a84ed7c78948..3dfa7ef99b5b 100644 --- a/plugins/kotlin/idea/tests/testData/inspections/dfa/InlineLambda.kt +++ b/plugins/kotlin/idea/tests/testData/inspections/dfa/InlineLambda.kt @@ -92,7 +92,7 @@ fun atLeastOnce() { if (x == 2) {} } -@OptIn(kotlin.contracts.ExperimentalContracts::class) +@OptIn(kotlin.contracts.ExperimentalContracts::class) inline fun runAtLeastOnce(lambda: () -> Unit) { contract { callsInPlace(lambda, InvocationKind.AT_LEAST_ONCE) diff --git a/plugins/kotlin/idea/tests/testData/inspectionsLocal/complexRedundantLet/binarySafeCall.kt b/plugins/kotlin/idea/tests/testData/inspectionsLocal/complexRedundantLet/binarySafeCall.kt index 593130e6747d..9a3c5a0c3774 100644 --- a/plugins/kotlin/idea/tests/testData/inspectionsLocal/complexRedundantLet/binarySafeCall.kt +++ b/plugins/kotlin/idea/tests/testData/inspectionsLocal/complexRedundantLet/binarySafeCall.kt @@ -1,5 +1,6 @@ // PROBLEM: none // WITH_STDLIB +// ERROR: Type mismatch: inferred type is Int? but Int was expected val x = 1 val y = x.let { it + it?.hashCode() } \ No newline at end of file diff --git a/plugins/kotlin/idea/tests/testData/inspectionsLocal/liftOut/whenToAssignment/whenHasMissingCase.kt b/plugins/kotlin/idea/tests/testData/inspectionsLocal/liftOut/whenToAssignment/whenHasMissingCase.kt index 8cd145ff7141..1b87250571e5 100644 --- a/plugins/kotlin/idea/tests/testData/inspectionsLocal/liftOut/whenToAssignment/whenHasMissingCase.kt +++ b/plugins/kotlin/idea/tests/testData/inspectionsLocal/liftOut/whenToAssignment/whenHasMissingCase.kt @@ -1,3 +1,4 @@ +// ERROR: 'when' expression must be exhaustive, add necessary 'C' branch or 'else' branch instead // PROBLEM: none enum class TestEnum{ diff --git a/plugins/kotlin/idea/tests/testData/inspectionsLocal/liftOut/whenToReturn/whenHasMissingCase.kt b/plugins/kotlin/idea/tests/testData/inspectionsLocal/liftOut/whenToReturn/whenHasMissingCase.kt index ddb360ec2742..fc23b753f674 100644 --- a/plugins/kotlin/idea/tests/testData/inspectionsLocal/liftOut/whenToReturn/whenHasMissingCase.kt +++ b/plugins/kotlin/idea/tests/testData/inspectionsLocal/liftOut/whenToReturn/whenHasMissingCase.kt @@ -1,3 +1,4 @@ +// ERROR: 'when' expression must be exhaustive, add necessary 'C' branch or 'else' branch instead // ERROR: A 'return' expression required in a function with a block body ('{...}') // PROBLEM: none diff --git a/plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantUnitExpression/unitReturnType5.kt b/plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantUnitExpression/unitReturnType5.kt index d5212b83436d..48a6c0be87ea 100644 --- a/plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantUnitExpression/unitReturnType5.kt +++ b/plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantUnitExpression/unitReturnType5.kt @@ -8,7 +8,7 @@ abstract class A { class B : A() { override fun a() = doIt { - 1.let { it.let { it.let { it.let { it?.doDo() } } } } + 1.let { it.let { it.let { it.let { it.doDo() } } } } Unit } } diff --git a/plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantUnitExpression/unitReturnType5.kt.after b/plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantUnitExpression/unitReturnType5.kt.after index 05e8b67629b9..0ee04bfb4d5d 100644 --- a/plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantUnitExpression/unitReturnType5.kt.after +++ b/plugins/kotlin/idea/tests/testData/inspectionsLocal/redundantUnitExpression/unitReturnType5.kt.after @@ -8,7 +8,7 @@ abstract class A { class B : A() { override fun a() = doIt { - 1.let { it.let { it.let { it.let { it?.doDo() } } } } + 1.let { it.let { it.let { it.let { it.doDo() } } } } } } diff --git a/plugins/kotlin/idea/tests/testData/inspectionsLocal/simpleRedundantLet/binarySafeCall.kt b/plugins/kotlin/idea/tests/testData/inspectionsLocal/simpleRedundantLet/binarySafeCall.kt index 593130e6747d..9a3c5a0c3774 100644 --- a/plugins/kotlin/idea/tests/testData/inspectionsLocal/simpleRedundantLet/binarySafeCall.kt +++ b/plugins/kotlin/idea/tests/testData/inspectionsLocal/simpleRedundantLet/binarySafeCall.kt @@ -1,5 +1,6 @@ // PROBLEM: none // WITH_STDLIB +// ERROR: Type mismatch: inferred type is Int? but Int was expected val x = 1 val y = x.let { it + it?.hashCode() } \ No newline at end of file diff --git a/plugins/kotlin/idea/tests/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/elvisWhenUnitNonExhaustive.kt b/plugins/kotlin/idea/tests/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/elvisWhenUnitNonExhaustive.kt index 82cbd9c78f7a..bf8e7f0173aa 100644 --- a/plugins/kotlin/idea/tests/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/elvisWhenUnitNonExhaustive.kt +++ b/plugins/kotlin/idea/tests/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/elvisWhenUnitNonExhaustive.kt @@ -1,3 +1,4 @@ +// ERROR: 'when' expression must be exhaustive, add necessary 'RW' branch or 'else' branch instead // PROBLEM: none enum class AccessMode { READ, WRITE, RW } diff --git a/plugins/kotlin/idea/tests/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/ifWhenUnitNonExhaustive.kt b/plugins/kotlin/idea/tests/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/ifWhenUnitNonExhaustive.kt index 8123adc86584..23f5741cf1aa 100644 --- a/plugins/kotlin/idea/tests/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/ifWhenUnitNonExhaustive.kt +++ b/plugins/kotlin/idea/tests/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/ifWhenUnitNonExhaustive.kt @@ -1,3 +1,4 @@ +// ERROR: 'when' expression must be exhaustive, add necessary 'RW' branch or 'else' branch instead // PROBLEM: none enum class AccessMode { READ, WRITE, RW } diff --git a/plugins/kotlin/idea/tests/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/lambdaWhenUnitNonExhaustive.kt b/plugins/kotlin/idea/tests/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/lambdaWhenUnitNonExhaustive.kt index 4a9c7a26ad32..e093864186a0 100644 --- a/plugins/kotlin/idea/tests/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/lambdaWhenUnitNonExhaustive.kt +++ b/plugins/kotlin/idea/tests/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/lambdaWhenUnitNonExhaustive.kt @@ -1,3 +1,4 @@ +// ERROR: 'when' expression must be exhaustive, add necessary 'RW' branch or 'else' branch instead // IS_APPLICABLE: true enum class AccessMode { READ, WRITE, RW } fun run(f: () -> T) = f() diff --git a/plugins/kotlin/idea/tests/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/lambdaWhenUnitNonExhaustive.kt.after b/plugins/kotlin/idea/tests/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/lambdaWhenUnitNonExhaustive.kt.after index aa37ea55f7c4..17361ae955f3 100644 --- a/plugins/kotlin/idea/tests/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/lambdaWhenUnitNonExhaustive.kt.after +++ b/plugins/kotlin/idea/tests/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/lambdaWhenUnitNonExhaustive.kt.after @@ -1,3 +1,4 @@ +// ERROR: 'when' expression must be exhaustive, add necessary 'RW' branch or 'else' branch instead // IS_APPLICABLE: true enum class AccessMode { READ, WRITE, RW } fun run(f: () -> T) = f() diff --git a/plugins/kotlin/idea/tests/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/whenUnitNonExhaustive.kt b/plugins/kotlin/idea/tests/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/whenUnitNonExhaustive.kt index d1f703ce9fd4..bd0f4d010b10 100644 --- a/plugins/kotlin/idea/tests/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/whenUnitNonExhaustive.kt +++ b/plugins/kotlin/idea/tests/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/whenUnitNonExhaustive.kt @@ -1,3 +1,4 @@ +// ERROR: 'when' expression must be exhaustive, add necessary 'RW' branch or 'else' branch instead // PROBLEM: none enum class AccessMode { READ, WRITE, RW } diff --git a/plugins/kotlin/idea/tests/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/whenWhenNonExhaustive.kt b/plugins/kotlin/idea/tests/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/whenWhenNonExhaustive.kt index 8f3b5c7c9807..07b7bb0fbe1c 100644 --- a/plugins/kotlin/idea/tests/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/whenWhenNonExhaustive.kt +++ b/plugins/kotlin/idea/tests/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/whenWhenNonExhaustive.kt @@ -1,3 +1,4 @@ +// ERROR: 'when' expression must be exhaustive, add necessary 'false' branch or 'else' branch instead // PROBLEM: none enum class AccessMode { READ, WRITE, RW } diff --git a/plugins/kotlin/idea/tests/testData/intentions/addWhenRemainingBranches/emptyWhen.kt b/plugins/kotlin/idea/tests/testData/intentions/addWhenRemainingBranches/emptyWhen.kt index 5c22274a87ad..0028dcf430ba 100644 --- a/plugins/kotlin/idea/tests/testData/intentions/addWhenRemainingBranches/emptyWhen.kt +++ b/plugins/kotlin/idea/tests/testData/intentions/addWhenRemainingBranches/emptyWhen.kt @@ -1,3 +1,4 @@ +// SKIP_ERRORS_BEFORE // WITH_STDLIB enum class Entry { diff --git a/plugins/kotlin/idea/tests/testData/intentions/addWhenRemainingBranches/emptyWhen.kt.after b/plugins/kotlin/idea/tests/testData/intentions/addWhenRemainingBranches/emptyWhen.kt.after index e3eb75f20965..7d3be33d6967 100644 --- a/plugins/kotlin/idea/tests/testData/intentions/addWhenRemainingBranches/emptyWhen.kt.after +++ b/plugins/kotlin/idea/tests/testData/intentions/addWhenRemainingBranches/emptyWhen.kt.after @@ -1,3 +1,4 @@ +// SKIP_ERRORS_BEFORE // WITH_STDLIB enum class Entry { diff --git a/plugins/kotlin/idea/tests/testData/intentions/addWhenRemainingBranches/noElse.kt b/plugins/kotlin/idea/tests/testData/intentions/addWhenRemainingBranches/noElse.kt index 11d9d87be3c5..81d0e7e2a8b6 100644 --- a/plugins/kotlin/idea/tests/testData/intentions/addWhenRemainingBranches/noElse.kt +++ b/plugins/kotlin/idea/tests/testData/intentions/addWhenRemainingBranches/noElse.kt @@ -1,4 +1,5 @@ // WITH_STDLIB +// SKIP_ERRORS_BEFORE enum class Entry { FOO, BAR, BAZ diff --git a/plugins/kotlin/idea/tests/testData/intentions/addWhenRemainingBranches/noElse.kt.after b/plugins/kotlin/idea/tests/testData/intentions/addWhenRemainingBranches/noElse.kt.after index 4f307e6d7fd3..1ed60bae2373 100644 --- a/plugins/kotlin/idea/tests/testData/intentions/addWhenRemainingBranches/noElse.kt.after +++ b/plugins/kotlin/idea/tests/testData/intentions/addWhenRemainingBranches/noElse.kt.after @@ -1,4 +1,5 @@ // WITH_STDLIB +// SKIP_ERRORS_BEFORE enum class Entry { FOO, BAR, BAZ diff --git a/plugins/kotlin/idea/tests/testData/intentions/branched/ifWhen/whenToIf/whenTrueOrFalse3.kt b/plugins/kotlin/idea/tests/testData/intentions/branched/ifWhen/whenToIf/whenTrueOrFalse3.kt index f00deb956523..81022b7b6b3f 100644 --- a/plugins/kotlin/idea/tests/testData/intentions/branched/ifWhen/whenToIf/whenTrueOrFalse3.kt +++ b/plugins/kotlin/idea/tests/testData/intentions/branched/ifWhen/whenToIf/whenTrueOrFalse3.kt @@ -1,3 +1,4 @@ +// SKIP_ERRORS_BEFORE // AFTER-WARNING: The expression is unused // AFTER-WARNING: The expression is unused fun foo(i : Int) { diff --git a/plugins/kotlin/idea/tests/testData/intentions/branched/ifWhen/whenToIf/whenTrueOrFalse3.kt.after b/plugins/kotlin/idea/tests/testData/intentions/branched/ifWhen/whenToIf/whenTrueOrFalse3.kt.after index acae8238c431..77153d280cde 100644 --- a/plugins/kotlin/idea/tests/testData/intentions/branched/ifWhen/whenToIf/whenTrueOrFalse3.kt.after +++ b/plugins/kotlin/idea/tests/testData/intentions/branched/ifWhen/whenToIf/whenTrueOrFalse3.kt.after @@ -1,3 +1,4 @@ +// SKIP_ERRORS_BEFORE // AFTER-WARNING: The expression is unused // AFTER-WARNING: The expression is unused fun foo(i : Int) { diff --git a/plugins/kotlin/idea/tests/testData/intentions/branched/safeAccessToIfThen/simplePropertyAsReceiver3.kt b/plugins/kotlin/idea/tests/testData/intentions/branched/safeAccessToIfThen/simplePropertyAsReceiver3.kt index 9bf654badf71..4c22fd404415 100644 --- a/plugins/kotlin/idea/tests/testData/intentions/branched/safeAccessToIfThen/simplePropertyAsReceiver3.kt +++ b/plugins/kotlin/idea/tests/testData/intentions/branched/safeAccessToIfThen/simplePropertyAsReceiver3.kt @@ -1,5 +1,4 @@ // AFTER-WARNING: Parameter 'args' is never used -// AFTER-WARNING: Safe call on a non-null receiver will have nullable type in future releases
Right now safe call on non nullable receiver has not null type: `"hello"?.length` has type Int
In future releases all safe calls will have nullable type: `"hello"?.length` will have type Int? // AFTER-WARNING: Unnecessary safe call on a non-null receiver of type B? // AFTER-WARNING: Variable 'x' is never used class B { diff --git a/plugins/kotlin/idea/tests/testData/intentions/branched/safeAccessToIfThen/simplePropertyAsReceiver3.kt.after b/plugins/kotlin/idea/tests/testData/intentions/branched/safeAccessToIfThen/simplePropertyAsReceiver3.kt.after index cd45506af8e1..7973d7819975 100644 --- a/plugins/kotlin/idea/tests/testData/intentions/branched/safeAccessToIfThen/simplePropertyAsReceiver3.kt.after +++ b/plugins/kotlin/idea/tests/testData/intentions/branched/safeAccessToIfThen/simplePropertyAsReceiver3.kt.after @@ -1,5 +1,4 @@ // AFTER-WARNING: Parameter 'args' is never used -// AFTER-WARNING: Safe call on a non-null receiver will have nullable type in future releases
Right now safe call on non nullable receiver has not null type: `"hello"?.length` has type Int
In future releases all safe calls will have nullable type: `"hello"?.length` will have type Int? // AFTER-WARNING: Unnecessary safe call on a non-null receiver of type B? // AFTER-WARNING: Variable 'x' is never used class B { diff --git a/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/reduceOrNull.kt b/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/reduceOrNull.kt index 356d6a048482..283e2600fd16 100644 --- a/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/reduceOrNull.kt +++ b/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/reduceOrNull.kt @@ -1,6 +1,5 @@ // INTENTION_TEXT: "Convert to 'reduceIndexedOrNull'" // WITH_STDLIB -// AFTER-WARNING: This annotation should be used with the compiler argument '-opt-in=kotlin.RequiresOptIn' // TODO: fix warning? // AFTER-WARNING: Parameter 'index' is never used, could be renamed to _ @OptIn(ExperimentalStdlibApi::class) diff --git a/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/reduceOrNull.kt.after b/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/reduceOrNull.kt.after index 36f4b2d883f7..c8c2b9a5049c 100644 --- a/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/reduceOrNull.kt.after +++ b/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/reduceOrNull.kt.after @@ -1,6 +1,5 @@ // INTENTION_TEXT: "Convert to 'reduceIndexedOrNull'" // WITH_STDLIB -// AFTER-WARNING: This annotation should be used with the compiler argument '-opt-in=kotlin.RequiresOptIn' // TODO: fix warning? // AFTER-WARNING: Parameter 'index' is never used, could be renamed to _ @OptIn(ExperimentalStdlibApi::class) diff --git a/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/reduceRightOrNull.kt b/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/reduceRightOrNull.kt index eeb40fe8df2c..7e6904fccf03 100644 --- a/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/reduceRightOrNull.kt +++ b/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/reduceRightOrNull.kt @@ -1,6 +1,5 @@ // INTENTION_TEXT: "Convert to 'reduceRightIndexedOrNull'" // WITH_STDLIB -// AFTER-WARNING: This annotation should be used with the compiler argument '-opt-in=kotlin.RequiresOptIn' // TODO: fix warning? // AFTER-WARNING: Parameter 'index' is never used, could be renamed to _ @OptIn(ExperimentalStdlibApi::class) diff --git a/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/reduceRightOrNull.kt.after b/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/reduceRightOrNull.kt.after index d19fadf62b8e..2703a8b66680 100644 --- a/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/reduceRightOrNull.kt.after +++ b/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/reduceRightOrNull.kt.after @@ -1,6 +1,5 @@ // INTENTION_TEXT: "Convert to 'reduceRightIndexedOrNull'" // WITH_STDLIB -// AFTER-WARNING: This annotation should be used with the compiler argument '-opt-in=kotlin.RequiresOptIn' // TODO: fix warning? // AFTER-WARNING: Parameter 'index' is never used, could be renamed to _ @OptIn(ExperimentalStdlibApi::class) diff --git a/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/runningReduce.kt b/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/runningReduce.kt index d6ef4fdc0385..91ae306203d6 100644 --- a/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/runningReduce.kt +++ b/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/runningReduce.kt @@ -1,6 +1,5 @@ // INTENTION_TEXT: "Convert to 'runningReduceIndexed'" // WITH_STDLIB -// AFTER-WARNING: This annotation should be used with the compiler argument '-opt-in=kotlin.RequiresOptIn' // TODO: fix warning? // AFTER-WARNING: Parameter 'index' is never used, could be renamed to _ @OptIn(ExperimentalStdlibApi::class) diff --git a/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/runningReduce.kt.after b/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/runningReduce.kt.after index 4989a805291b..9cb5d283aac1 100644 --- a/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/runningReduce.kt.after +++ b/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/runningReduce.kt.after @@ -1,6 +1,5 @@ // INTENTION_TEXT: "Convert to 'runningReduceIndexed'" // WITH_STDLIB -// AFTER-WARNING: This annotation should be used with the compiler argument '-opt-in=kotlin.RequiresOptIn' // TODO: fix warning? // AFTER-WARNING: Parameter 'index' is never used, could be renamed to _ @OptIn(ExperimentalStdlibApi::class) diff --git a/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/scan.kt b/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/scan.kt index 15a427eb50f0..2333b45406b6 100644 --- a/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/scan.kt +++ b/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/scan.kt @@ -1,6 +1,5 @@ // INTENTION_TEXT: "Convert to 'scanIndexed'" // WITH_STDLIB -// AFTER-WARNING: This annotation should be used with the compiler argument '-opt-in=kotlin.RequiresOptIn' // TODO: fix warning? // AFTER-WARNING: Parameter 'index' is never used, could be renamed to _ @OptIn(ExperimentalStdlibApi::class) diff --git a/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/scan.kt.after b/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/scan.kt.after index 3f7480176213..acb0e1afa39c 100644 --- a/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/scan.kt.after +++ b/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/scan.kt.after @@ -1,6 +1,5 @@ // INTENTION_TEXT: "Convert to 'scanIndexed'" // WITH_STDLIB -// AFTER-WARNING: This annotation should be used with the compiler argument '-opt-in=kotlin.RequiresOptIn' // TODO: fix warning? // AFTER-WARNING: Parameter 'index' is never used, could be renamed to _ @OptIn(ExperimentalStdlibApi::class) diff --git a/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/scanReduce.kt b/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/scanReduce.kt index 12675b9c8965..5ee8c899bda7 100644 --- a/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/scanReduce.kt +++ b/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/scanReduce.kt @@ -1,7 +1,6 @@ // INTENTION_TEXT: "Convert to 'runningReduceIndexed'" // WITH_STDLIB // DISABLE-ERRORS -// AFTER-WARNING: This annotation should be used with the compiler argument '-opt-in=kotlin.RequiresOptIn' // TODO: fix warning? // AFTER-WARNING: Parameter 'index' is never used, could be renamed to _ @OptIn(ExperimentalStdlibApi::class) diff --git a/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/scanReduce.kt.after b/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/scanReduce.kt.after index 2c27e69160f7..8fdffa948537 100644 --- a/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/scanReduce.kt.after +++ b/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/scanReduce.kt.after @@ -1,7 +1,6 @@ // INTENTION_TEXT: "Convert to 'runningReduceIndexed'" // WITH_STDLIB // DISABLE-ERRORS -// AFTER-WARNING: This annotation should be used with the compiler argument '-opt-in=kotlin.RequiresOptIn' // TODO: fix warning? // AFTER-WARNING: Parameter 'index' is never used, could be renamed to _ @OptIn(ExperimentalStdlibApi::class) diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMember.after.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMember.after.kt index f62407f96f96..8a86545fd6b2 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMember.after.kt +++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMember.after.kt @@ -1,5 +1,6 @@ // "Create class 'Foo'" "true" // ERROR: Unresolved reference: Foo +// ERROR: 'public' property exposes its 'public/*package*/' type B class A internal constructor(val b: B) { internal fun test() = B.Foo(2, "2") diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMember.before.Main.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMember.before.Main.kt index 194b187a194b..a14fd14a46c5 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMember.before.Main.kt +++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMember.before.Main.kt @@ -1,5 +1,6 @@ // "Create class 'Foo'" "true" // ERROR: Unresolved reference: Foo +// ERROR: 'public' property exposes its 'public/*package*/' type B class A internal constructor(val b: B) { internal fun test() = B.Foo(2, "2") diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMemberInner.after.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMemberInner.after.kt index 6d9af98f681a..12cdffdb5a1a 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMemberInner.after.kt +++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMemberInner.after.kt @@ -1,5 +1,6 @@ // "Create class 'Foo'" "true" // ERROR: Unresolved reference: Foo +// ERROR: 'public' property exposes its 'public/*package*/' type B class A internal constructor(val b: B) { internal fun test() = b.Foo(2, "2") diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMemberInner.before.Main.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMemberInner.before.Main.kt index ee27a78a071e..2d1d6fb8d5da 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMemberInner.before.Main.kt +++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMemberInner.before.Main.kt @@ -1,5 +1,6 @@ // "Create class 'Foo'" "true" // ERROR: Unresolved reference: Foo +// ERROR: 'public' property exposes its 'public/*package*/' type B class A internal constructor(val b: B) { internal fun test() = b.Foo(2, "2") diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMemberInnerPartialSubstitution.after.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMemberInnerPartialSubstitution.after.kt index 2bb5082fb6b4..f91bf4cb0f53 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMemberInnerPartialSubstitution.after.kt +++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMemberInnerPartialSubstitution.after.kt @@ -1,5 +1,6 @@ // "Create class 'Foo'" "true" // ERROR: Unresolved reference: Foo +// ERROR: 'public' property exposes its 'public/*package*/' type B class A internal constructor(val b: B) { internal fun test() = b.Foo(2, "2") diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMemberInnerPartialSubstitution.before.Main.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMemberInnerPartialSubstitution.before.Main.kt index a372a98d192a..1586a39656bb 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMemberInnerPartialSubstitution.before.Main.kt +++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMemberInnerPartialSubstitution.before.Main.kt @@ -1,5 +1,6 @@ // "Create class 'Foo'" "true" // ERROR: Unresolved reference: Foo +// ERROR: 'public' property exposes its 'public/*package*/' type B class A internal constructor(val b: B) { internal fun test() = b.Foo(2, "2") diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMemberInnerWithReceiverArg.after.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMemberInnerWithReceiverArg.after.kt index 4e8ad4506682..aca27cf9a161 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMemberInnerWithReceiverArg.after.kt +++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMemberInnerWithReceiverArg.after.kt @@ -1,5 +1,6 @@ // "Create class 'Foo'" "true" // ERROR: Unresolved reference: Foo +// ERROR: 'public' property exposes its 'public/*package*/' type B class A internal constructor(val b: B) { internal fun test() = b.Foo(2, "2") diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMemberInnerWithReceiverArg.before.Main.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMemberInnerWithReceiverArg.before.Main.kt index 759291470a79..4329e12ee95d 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMemberInnerWithReceiverArg.before.Main.kt +++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMemberInnerWithReceiverArg.before.Main.kt @@ -1,5 +1,6 @@ // "Create class 'Foo'" "true" // ERROR: Unresolved reference: Foo +// ERROR: 'public' property exposes its 'public/*package*/' type B class A internal constructor(val b: B) { internal fun test() = b.Foo(2, "2") diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMemberPartialSubstitution.after.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMemberPartialSubstitution.after.kt index 5aa81397ff8e..a3859606c32a 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMemberPartialSubstitution.after.kt +++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMemberPartialSubstitution.after.kt @@ -1,5 +1,6 @@ // "Create class 'Foo'" "true" // ERROR: Unresolved reference: Foo +// ERROR: 'public' property exposes its 'public/*package*/' type B class A internal constructor(val b: B) { internal fun test() = B.Foo(2, "2") diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMemberPartialSubstitution.before.Main.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMemberPartialSubstitution.before.Main.kt index b7f2e9895dfb..99c34c118ad6 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMemberPartialSubstitution.before.Main.kt +++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/javaClassMemberPartialSubstitution.before.Main.kt @@ -1,5 +1,6 @@ // "Create class 'Foo'" "true" // ERROR: Unresolved reference: Foo +// ERROR: 'public' property exposes its 'public/*package*/' type B class A internal constructor(val b: B) { internal fun test() = B.Foo(2, "2") diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/call/typeArguments/javaClassMember.after.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/call/typeArguments/javaClassMember.after.kt index ebc3a95cc97b..e143356fb0ab 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/call/typeArguments/javaClassMember.after.kt +++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/call/typeArguments/javaClassMember.after.kt @@ -1,5 +1,6 @@ // "Create member function 'B.foo'" "true" // ERROR: Unresolved reference: foo +// ERROR: 'public' property exposes its 'public/*package*/' type B class A internal constructor(val b: B) { fun test(): Int { diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/call/typeArguments/javaClassMember.before.Main.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/call/typeArguments/javaClassMember.before.Main.kt index 0c990c906bac..2e4452583089 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/call/typeArguments/javaClassMember.before.Main.kt +++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/call/typeArguments/javaClassMember.before.Main.kt @@ -1,5 +1,6 @@ // "Create member function 'B.foo'" "true" // ERROR: Unresolved reference: foo +// ERROR: 'public' property exposes its 'public/*package*/' type B class A internal constructor(val b: B) { fun test(): Int { diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/call/typeArguments/javaClassMemberPartialSubstitution.after.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/call/typeArguments/javaClassMemberPartialSubstitution.after.kt index 7a7b1758819e..c803a60b957f 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/call/typeArguments/javaClassMemberPartialSubstitution.after.kt +++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/call/typeArguments/javaClassMemberPartialSubstitution.after.kt @@ -1,5 +1,6 @@ // "Create member function 'B.foo'" "true" // ERROR: Unresolved reference: foo +// ERROR: 'public' property exposes its 'public/*package*/' type B class A internal constructor(val b: B) { fun test(): Int { diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/call/typeArguments/javaClassMemberPartialSubstitution.before.Main.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/call/typeArguments/javaClassMemberPartialSubstitution.before.Main.kt index c1a57bfbb18f..f704fee53707 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/call/typeArguments/javaClassMemberPartialSubstitution.before.Main.kt +++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/call/typeArguments/javaClassMemberPartialSubstitution.before.Main.kt @@ -1,5 +1,6 @@ // "Create member function 'B.foo'" "true" // ERROR: Unresolved reference: foo +// ERROR: 'public' property exposes its 'public/*package*/' type B class A internal constructor(val b: B) { fun test(): Int { diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/call/typeArguments/javaClassMemberWithReceiverArg.after.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/call/typeArguments/javaClassMemberWithReceiverArg.after.kt index ebc3a95cc97b..e143356fb0ab 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/call/typeArguments/javaClassMemberWithReceiverArg.after.kt +++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/call/typeArguments/javaClassMemberWithReceiverArg.after.kt @@ -1,5 +1,6 @@ // "Create member function 'B.foo'" "true" // ERROR: Unresolved reference: foo +// ERROR: 'public' property exposes its 'public/*package*/' type B class A internal constructor(val b: B) { fun test(): Int { diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/call/typeArguments/javaClassMemberWithReceiverArg.before.Main.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/call/typeArguments/javaClassMemberWithReceiverArg.before.Main.kt index d8428c3b7d33..baaaab7473ac 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/call/typeArguments/javaClassMemberWithReceiverArg.before.Main.kt +++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/call/typeArguments/javaClassMemberWithReceiverArg.before.Main.kt @@ -1,5 +1,6 @@ // "Create member function 'B.foo'" "true" // ERROR: Unresolved reference: foo +// ERROR: 'public' property exposes its 'public/*package*/' type B class A internal constructor(val b: B) { fun test(): Int { diff --git a/plugins/kotlin/idea/tests/testData/quickfix/nullables/unsafeInfixCall/unsafeComparisonInLogic.kt b/plugins/kotlin/idea/tests/testData/quickfix/nullables/unsafeInfixCall/unsafeComparisonInLogic.kt index 8cdea248e1f4..fc1f3d854584 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/nullables/unsafeInfixCall/unsafeComparisonInLogic.kt +++ b/plugins/kotlin/idea/tests/testData/quickfix/nullables/unsafeInfixCall/unsafeComparisonInLogic.kt @@ -4,7 +4,6 @@ // ACTION: Flip '>' // ACTION: Replace '&&' with '||' // ACTION: Replace overloaded operator with function call -// ACTION: Simplify boolean expression // ERROR: Operator call corresponds to a dot-qualified call 'w?.x.compareTo(42)' which is not allowed on a nullable receiver 'w?.x'. class Wrapper(val x: Int) diff --git a/plugins/kotlin/idea/tests/testData/quickfix/replaceWithDotCall/safeCallChain.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/replaceWithDotCall/safeCallChain.kt.after index c63ce1446e6b..327a9dc86a3b 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/replaceWithDotCall/safeCallChain.kt.after +++ b/plugins/kotlin/idea/tests/testData/quickfix/replaceWithDotCall/safeCallChain.kt.after @@ -4,5 +4,5 @@ class Bar(val baz: Baz) class Baz(val qux: Int) fun test(foo: Foo) { - foo.bar.baz.qux + foo.bar?.baz?.qux } diff --git a/plugins/kotlin/idea/tests/testData/quickfix/replaceWithDotCall/safeCallChain2.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/replaceWithDotCall/safeCallChain2.kt.after index 03f5038f769f..95bccd931686 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/replaceWithDotCall/safeCallChain2.kt.after +++ b/plugins/kotlin/idea/tests/testData/quickfix/replaceWithDotCall/safeCallChain2.kt.after @@ -4,5 +4,5 @@ class Bar(val baz: Baz?) class Baz(val qux: Int) fun test(foo: Foo) { - foo.bar.baz?.qux + foo.bar?.baz?.qux } diff --git a/plugins/kotlin/idea/tests/testData/quickfix/surroundWithNullCheck/unsafeCallInsideWhen.kt b/plugins/kotlin/idea/tests/testData/quickfix/surroundWithNullCheck/unsafeCallInsideWhen.kt index 3278e508844e..4b336d56ef65 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/surroundWithNullCheck/unsafeCallInsideWhen.kt +++ b/plugins/kotlin/idea/tests/testData/quickfix/surroundWithNullCheck/unsafeCallInsideWhen.kt @@ -1,4 +1,5 @@ // "Surround with null check" "true" +// ERROR: 'when' expression must be exhaustive, add necessary 'false' branch or 'else' branch instead fun foo(arg: Int?, flag: Boolean) { when (flag) { diff --git a/plugins/kotlin/idea/tests/testData/quickfix/surroundWithNullCheck/unsafeCallInsideWhen.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/surroundWithNullCheck/unsafeCallInsideWhen.kt.after index 2e618d331b71..9b5c2d414600 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/surroundWithNullCheck/unsafeCallInsideWhen.kt.after +++ b/plugins/kotlin/idea/tests/testData/quickfix/surroundWithNullCheck/unsafeCallInsideWhen.kt.after @@ -1,4 +1,5 @@ // "Surround with null check" "true" +// ERROR: 'when' expression must be exhaustive, add necessary 'false' branch or 'else' branch instead fun foo(arg: Int?, flag: Boolean) { when (flag) { diff --git a/plugins/kotlin/idea/tests/testData/quickfix/when/addRemainingBranchesAnotherPackage.after.kt b/plugins/kotlin/idea/tests/testData/quickfix/when/addRemainingBranchesAnotherPackage.after.kt index 824f91d9456e..759876c96880 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/when/addRemainingBranchesAnotherPackage.after.kt +++ b/plugins/kotlin/idea/tests/testData/quickfix/when/addRemainingBranchesAnotherPackage.after.kt @@ -1,4 +1,5 @@ // "Add remaining branches" "true" +// ERROR: 'when' expression must be exhaustive, add necessary 'RED', 'GREEN', 'BLUE' branches or 'else' branch instead package u diff --git a/plugins/kotlin/idea/tests/testData/quickfix/when/addRemainingBranchesAnotherPackage.before.Main.kt b/plugins/kotlin/idea/tests/testData/quickfix/when/addRemainingBranchesAnotherPackage.before.Main.kt index 2938c0cf3400..0145754470ec 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/when/addRemainingBranchesAnotherPackage.before.Main.kt +++ b/plugins/kotlin/idea/tests/testData/quickfix/when/addRemainingBranchesAnotherPackage.before.Main.kt @@ -1,4 +1,5 @@ // "Add remaining branches" "true" +// ERROR: 'when' expression must be exhaustive, add necessary 'RED', 'GREEN', 'BLUE' branches or 'else' branch instead package u diff --git a/plugins/kotlin/idea/tests/testData/quickfix/when/addRemainingBranchesAnotherPackageAll.after.kt b/plugins/kotlin/idea/tests/testData/quickfix/when/addRemainingBranchesAnotherPackageAll.after.kt index 68770b141d19..619d5f306ac2 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/when/addRemainingBranchesAnotherPackageAll.after.kt +++ b/plugins/kotlin/idea/tests/testData/quickfix/when/addRemainingBranchesAnotherPackageAll.after.kt @@ -1,4 +1,5 @@ // "Add remaining branches with * import" "true" +// ERROR: 'when' expression must be exhaustive, add necessary 'RED', 'GREEN', 'BLUE' branches or 'else' branch instead package u diff --git a/plugins/kotlin/idea/tests/testData/quickfix/when/addRemainingBranchesAnotherPackageAll.before.Main.kt b/plugins/kotlin/idea/tests/testData/quickfix/when/addRemainingBranchesAnotherPackageAll.before.Main.kt index 74386e7636db..73ef8b7e85c4 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/when/addRemainingBranchesAnotherPackageAll.before.Main.kt +++ b/plugins/kotlin/idea/tests/testData/quickfix/when/addRemainingBranchesAnotherPackageAll.before.Main.kt @@ -1,4 +1,5 @@ // "Add remaining branches with * import" "true" +// ERROR: 'when' expression must be exhaustive, add necessary 'RED', 'GREEN', 'BLUE' branches or 'else' branch instead package u diff --git a/plugins/kotlin/idea/tests/testData/quickfix/when/addRemainingBranchesMissingRightParenthesis.kt b/plugins/kotlin/idea/tests/testData/quickfix/when/addRemainingBranchesMissingRightParenthesis.kt index 43265c06df08..0681fea56ed0 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/when/addRemainingBranchesMissingRightParenthesis.kt +++ b/plugins/kotlin/idea/tests/testData/quickfix/when/addRemainingBranchesMissingRightParenthesis.kt @@ -1,4 +1,5 @@ // "Add remaining branches" "false" +// ERROR: 'when' expression must be exhaustive, add necessary 'is B' branch or 'else' branch instead // WITH_STDLIB sealed class A diff --git a/plugins/kotlin/idea/tests/testData/quickfix/wrapWhenExpressionInParentheses/logicalExpressionInWhen.kt b/plugins/kotlin/idea/tests/testData/quickfix/wrapWhenExpressionInParentheses/logicalExpressionInWhen.kt index 7ff1c9fcd713..635d943f22e4 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/wrapWhenExpressionInParentheses/logicalExpressionInWhen.kt +++ b/plugins/kotlin/idea/tests/testData/quickfix/wrapWhenExpressionInParentheses/logicalExpressionInWhen.kt @@ -1,4 +1,5 @@ // "Wrap expression in parentheses" "true" +// ERROR: 'when' expression must be exhaustive, add necessary 'true', 'false' branches or 'else' branch instead interface A { operator fun contains(other: A): Boolean } diff --git a/plugins/kotlin/idea/tests/testData/quickfix/wrapWhenExpressionInParentheses/logicalExpressionInWhen.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/wrapWhenExpressionInParentheses/logicalExpressionInWhen.kt.after index 4f36b40f5de7..140717982a2c 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/wrapWhenExpressionInParentheses/logicalExpressionInWhen.kt.after +++ b/plugins/kotlin/idea/tests/testData/quickfix/wrapWhenExpressionInParentheses/logicalExpressionInWhen.kt.after @@ -1,4 +1,5 @@ // "Wrap expression in parentheses" "true" +// ERROR: 'when' expression must be exhaustive, add necessary 'true', 'false' branches or 'else' branch instead interface A { operator fun contains(other: A): Boolean } diff --git a/plugins/kotlin/idea/tests/testData/refactoring/inline/namedFunction/Sequence.kt.after b/plugins/kotlin/idea/tests/testData/refactoring/inline/namedFunction/Sequence.kt.after index fe66f6083ddb..c74d73d93afe 100644 --- a/plugins/kotlin/idea/tests/testData/refactoring/inline/namedFunction/Sequence.kt.after +++ b/plugins/kotlin/idea/tests/testData/refactoring/inline/namedFunction/Sequence.kt.after @@ -6,8 +6,8 @@ fun mySeq(f: MySeq.() -> Unit): MySeq = null!! class Test { fun repro() = mySeq { - mySeq { - yield(1.0) + mySeq { + this.yield(1.0) } } diff --git a/plugins/kotlin/idea/tests/testData/refactoring/inline/namedFunction/UnitReturnType4.kt b/plugins/kotlin/idea/tests/testData/refactoring/inline/namedFunction/UnitReturnType4.kt index 9110b6b50d61..2b25d4b77cc2 100644 --- a/plugins/kotlin/idea/tests/testData/refactoring/inline/namedFunction/UnitReturnType4.kt +++ b/plugins/kotlin/idea/tests/testData/refactoring/inline/namedFunction/UnitReturnType4.kt @@ -6,7 +6,7 @@ abstract class A { } fun foo() { - 1.let { it.let { it.let { it.let { it?.doDo() } } } } + 1.let { it.let { it.let { it.let { it.doDo() } } } } } class B : A() { diff --git a/plugins/kotlin/idea/tests/testData/refactoring/inline/namedFunction/UnitReturnType4.kt.after b/plugins/kotlin/idea/tests/testData/refactoring/inline/namedFunction/UnitReturnType4.kt.after index 7b6beaf70139..41372980824c 100644 --- a/plugins/kotlin/idea/tests/testData/refactoring/inline/namedFunction/UnitReturnType4.kt.after +++ b/plugins/kotlin/idea/tests/testData/refactoring/inline/namedFunction/UnitReturnType4.kt.after @@ -7,6 +7,6 @@ abstract class A { class B : A() { override fun a() = doIt { - 1.let { it.let { it.let { it.let { it?.doDo() } } } } + 1.let { it.let { it.let { it.let { it.doDo() } } } } } } \ No newline at end of file