diff --git a/idea/idea-fir/tests/org/jetbrains/kotlin/idea/quickfix/HighLevelQuickFixTestGenerated.java b/idea/idea-fir/tests/org/jetbrains/kotlin/idea/quickfix/HighLevelQuickFixTestGenerated.java index ae2a12ca005..8df0121db48 100644 --- a/idea/idea-fir/tests/org/jetbrains/kotlin/idea/quickfix/HighLevelQuickFixTestGenerated.java +++ b/idea/idea-fir/tests/org/jetbrains/kotlin/idea/quickfix/HighLevelQuickFixTestGenerated.java @@ -274,11 +274,26 @@ public class HighLevelQuickFixTestGenerated extends AbstractHighLevelQuickFixTes runTest("idea/testData/quickfix/addExclExclCall/iterable.kt"); } + @TestMetadata("iterableDoesNotInheritIterableInterface.kt") + public void testIterableDoesNotInheritIterableInterface() throws Exception { + runTest("idea/testData/quickfix/addExclExclCall/iterableDoesNotInheritIterableInterface.kt"); + } + + @TestMetadata("iterableGeneric.kt") + public void testIterableGeneric() throws Exception { + runTest("idea/testData/quickfix/addExclExclCall/iterableGeneric.kt"); + } + @TestMetadata("iterableInExtension.kt") public void testIterableInExtension() throws Exception { runTest("idea/testData/quickfix/addExclExclCall/iterableInExtension.kt"); } + @TestMetadata("iterableWithBadIterator.kt") + public void testIterableWithBadIterator() throws Exception { + runTest("idea/testData/quickfix/addExclExclCall/iterableWithBadIterator.kt"); + } + @TestMetadata("normal.kt") public void testNormal() throws Exception { runTest("idea/testData/quickfix/addExclExclCall/normal.kt"); @@ -299,16 +314,16 @@ public class HighLevelQuickFixTestGenerated extends AbstractHighLevelQuickFixTes runTest("idea/testData/quickfix/addExclExclCall/nullExpression.kt"); } + @TestMetadata("operationBinary.kt") + public void testOperationBinary() throws Exception { + runTest("idea/testData/quickfix/addExclExclCall/operationBinary.kt"); + } + @TestMetadata("operationIn.kt") public void testOperationIn() throws Exception { runTest("idea/testData/quickfix/addExclExclCall/operationIn.kt"); } - @TestMetadata("operationPlus.kt") - public void testOperationPlus() throws Exception { - runTest("idea/testData/quickfix/addExclExclCall/operationPlus.kt"); - } - @TestMetadata("operationUnary.kt") public void testOperationUnary() throws Exception { runTest("idea/testData/quickfix/addExclExclCall/operationUnary.kt"); @@ -526,41 +541,6 @@ public class HighLevelQuickFixTestGenerated extends AbstractHighLevelQuickFixTes KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/testData/quickfix/expressions"), Pattern.compile("^([\\w\\-_]+)\\.kt$"), null, true); } - @TestMetadata("fixNullableBinaryWithExclExcl.kt") - public void testFixNullableBinaryWithExclExcl() throws Exception { - runTest("idea/testData/quickfix/expressions/fixNullableBinaryWithExclExcl.kt"); - } - - @TestMetadata("fixNullableInfixWithExclExcl.kt") - public void testFixNullableInfixWithExclExcl() throws Exception { - runTest("idea/testData/quickfix/expressions/fixNullableInfixWithExclExcl.kt"); - } - - @TestMetadata("fixNullableIterableGenericWithExclExcl.kt") - public void testFixNullableIterableGenericWithExclExcl() throws Exception { - runTest("idea/testData/quickfix/expressions/fixNullableIterableGenericWithExclExcl.kt"); - } - - @TestMetadata("fixNullableIterableWithExclExcl.kt") - public void testFixNullableIterableWithExclExcl() throws Exception { - runTest("idea/testData/quickfix/expressions/fixNullableIterableWithExclExcl.kt"); - } - - @TestMetadata("fixNullableUnaryWithExclExcl.kt") - public void testFixNullableUnaryWithExclExcl() throws Exception { - runTest("idea/testData/quickfix/expressions/fixNullableUnaryWithExclExcl.kt"); - } - - @TestMetadata("fixNullableWithExclExclAbsentWithBadIterator.kt") - public void testFixNullableWithExclExclAbsentWithBadIterator() throws Exception { - runTest("idea/testData/quickfix/expressions/fixNullableWithExclExclAbsentWithBadIterator.kt"); - } - - @TestMetadata("fixNullableWithIteratorWithExclExcl.kt") - public void testFixNullableWithIteratorWithExclExcl() throws Exception { - runTest("idea/testData/quickfix/expressions/fixNullableWithIteratorWithExclExcl.kt"); - } - @TestMetadata("kt11594.kt") public void testKt11594() throws Exception { runTest("idea/testData/quickfix/expressions/kt11594.kt"); diff --git a/idea/testData/quickfix/addExclExclCall/infixCall.kt b/idea/testData/quickfix/addExclExclCall/infixCall.kt index cea7bb40cb5..39b8006b961 100644 --- a/idea/testData/quickfix/addExclExclCall/infixCall.kt +++ b/idea/testData/quickfix/addExclExclCall/infixCall.kt @@ -1,7 +1,9 @@ // "Add non-null asserted (!!) call" "true" -infix fun Int.bar(i: Int) = this +class SafeType { + infix fun op(arg: Int) {} +} -fun foo(i: Int?) { - i bar 1 -} \ No newline at end of file +fun safeB(p: SafeType?) { + val v = p op 42 +} diff --git a/idea/testData/quickfix/addExclExclCall/infixCall.kt.after b/idea/testData/quickfix/addExclExclCall/infixCall.kt.after index 943dc64cfe1..0849e2ee069 100644 --- a/idea/testData/quickfix/addExclExclCall/infixCall.kt.after +++ b/idea/testData/quickfix/addExclExclCall/infixCall.kt.after @@ -1,7 +1,9 @@ // "Add non-null asserted (!!) call" "true" -infix fun Int.bar(i: Int) = this +class SafeType { + infix fun op(arg: Int) {} +} -fun foo(i: Int?) { - i!! bar 1 -} \ No newline at end of file +fun safeB(p: SafeType?) { + val v = p!! op 42 +} diff --git a/idea/testData/quickfix/addExclExclCall/iterable.kt b/idea/testData/quickfix/addExclExclCall/iterable.kt index 22758f8f72f..5301cd62e10 100644 --- a/idea/testData/quickfix/addExclExclCall/iterable.kt +++ b/idea/testData/quickfix/addExclExclCall/iterable.kt @@ -1,6 +1,6 @@ // "Add non-null asserted (!!) call" "true" -// WITH_RUNTIME - -fun foo(a: List?) { - for (s in a) {} +fun foo() { + val test : Collection? = null!! + for (i in test) { } } + diff --git a/idea/testData/quickfix/addExclExclCall/iterable.kt.after b/idea/testData/quickfix/addExclExclCall/iterable.kt.after index 222f28fc3ad..fd82e0d5ddf 100644 --- a/idea/testData/quickfix/addExclExclCall/iterable.kt.after +++ b/idea/testData/quickfix/addExclExclCall/iterable.kt.after @@ -1,6 +1,6 @@ // "Add non-null asserted (!!) call" "true" -// WITH_RUNTIME - -fun foo(a: List?) { - for (s in a!!) {} +fun foo() { + val test : Collection? = null!! + for (i in test!!) { } } + diff --git a/idea/testData/quickfix/expressions/fixNullableWithIteratorWithExclExcl.kt b/idea/testData/quickfix/addExclExclCall/iterableDoesNotInheritIterableInterface.kt similarity index 100% rename from idea/testData/quickfix/expressions/fixNullableWithIteratorWithExclExcl.kt rename to idea/testData/quickfix/addExclExclCall/iterableDoesNotInheritIterableInterface.kt diff --git a/idea/testData/quickfix/expressions/fixNullableWithIteratorWithExclExcl.kt.after b/idea/testData/quickfix/addExclExclCall/iterableDoesNotInheritIterableInterface.kt.after similarity index 100% rename from idea/testData/quickfix/expressions/fixNullableWithIteratorWithExclExcl.kt.after rename to idea/testData/quickfix/addExclExclCall/iterableDoesNotInheritIterableInterface.kt.after diff --git a/idea/testData/quickfix/expressions/fixNullableIterableGenericWithExclExcl.kt b/idea/testData/quickfix/addExclExclCall/iterableGeneric.kt similarity index 100% rename from idea/testData/quickfix/expressions/fixNullableIterableGenericWithExclExcl.kt rename to idea/testData/quickfix/addExclExclCall/iterableGeneric.kt diff --git a/idea/testData/quickfix/expressions/fixNullableIterableGenericWithExclExcl.kt.after b/idea/testData/quickfix/addExclExclCall/iterableGeneric.kt.after similarity index 100% rename from idea/testData/quickfix/expressions/fixNullableIterableGenericWithExclExcl.kt.after rename to idea/testData/quickfix/addExclExclCall/iterableGeneric.kt.after diff --git a/idea/testData/quickfix/expressions/fixNullableWithExclExclAbsentWithBadIterator.kt b/idea/testData/quickfix/addExclExclCall/iterableWithBadIterator.kt similarity index 100% rename from idea/testData/quickfix/expressions/fixNullableWithExclExclAbsentWithBadIterator.kt rename to idea/testData/quickfix/addExclExclCall/iterableWithBadIterator.kt diff --git a/idea/testData/quickfix/expressions/fixNullableBinaryWithExclExcl.kt b/idea/testData/quickfix/addExclExclCall/operationBinary.kt similarity index 100% rename from idea/testData/quickfix/expressions/fixNullableBinaryWithExclExcl.kt rename to idea/testData/quickfix/addExclExclCall/operationBinary.kt diff --git a/idea/testData/quickfix/expressions/fixNullableBinaryWithExclExcl.kt.after b/idea/testData/quickfix/addExclExclCall/operationBinary.kt.after similarity index 100% rename from idea/testData/quickfix/expressions/fixNullableBinaryWithExclExcl.kt.after rename to idea/testData/quickfix/addExclExclCall/operationBinary.kt.after diff --git a/idea/testData/quickfix/addExclExclCall/operationPlus.kt b/idea/testData/quickfix/addExclExclCall/operationPlus.kt deleted file mode 100644 index eab3cb0bb73..00000000000 --- a/idea/testData/quickfix/addExclExclCall/operationPlus.kt +++ /dev/null @@ -1,5 +0,0 @@ -// "Add non-null asserted (!!) call" "true" - -fun foo(i: Int?) { - i + 1 -} \ No newline at end of file diff --git a/idea/testData/quickfix/addExclExclCall/operationPlus.kt.after b/idea/testData/quickfix/addExclExclCall/operationPlus.kt.after deleted file mode 100644 index 901d3ab6a47..00000000000 --- a/idea/testData/quickfix/addExclExclCall/operationPlus.kt.after +++ /dev/null @@ -1,5 +0,0 @@ -// "Add non-null asserted (!!) call" "true" - -fun foo(i: Int?) { - i!! + 1 -} \ No newline at end of file diff --git a/idea/testData/quickfix/addExclExclCall/operationUnary.kt b/idea/testData/quickfix/addExclExclCall/operationUnary.kt index 118f843043c..5d68ef20ca0 100644 --- a/idea/testData/quickfix/addExclExclCall/operationUnary.kt +++ b/idea/testData/quickfix/addExclExclCall/operationUnary.kt @@ -1,5 +1,9 @@ // "Add non-null asserted (!!) call" "true" -fun foo(i: Int?) { - -i -} \ No newline at end of file +class SafeType { + operator fun unaryMinus() {} +} + +fun safeB(p: SafeType?) { + val v = -p +} diff --git a/idea/testData/quickfix/addExclExclCall/operationUnary.kt.after b/idea/testData/quickfix/addExclExclCall/operationUnary.kt.after index 285266b9a4b..8a09c7a1464 100644 --- a/idea/testData/quickfix/addExclExclCall/operationUnary.kt.after +++ b/idea/testData/quickfix/addExclExclCall/operationUnary.kt.after @@ -1,5 +1,9 @@ // "Add non-null asserted (!!) call" "true" -fun foo(i: Int?) { - -i!! -} \ No newline at end of file +class SafeType { + operator fun unaryMinus() {} +} + +fun safeB(p: SafeType?) { + val v = -p!! +} diff --git a/idea/testData/quickfix/expressions/fixNullableInfixWithExclExcl.kt b/idea/testData/quickfix/expressions/fixNullableInfixWithExclExcl.kt deleted file mode 100644 index 39b8006b961..00000000000 --- a/idea/testData/quickfix/expressions/fixNullableInfixWithExclExcl.kt +++ /dev/null @@ -1,9 +0,0 @@ -// "Add non-null asserted (!!) call" "true" - -class SafeType { - infix fun op(arg: Int) {} -} - -fun safeB(p: SafeType?) { - val v = p op 42 -} diff --git a/idea/testData/quickfix/expressions/fixNullableInfixWithExclExcl.kt.after b/idea/testData/quickfix/expressions/fixNullableInfixWithExclExcl.kt.after deleted file mode 100644 index 0849e2ee069..00000000000 --- a/idea/testData/quickfix/expressions/fixNullableInfixWithExclExcl.kt.after +++ /dev/null @@ -1,9 +0,0 @@ -// "Add non-null asserted (!!) call" "true" - -class SafeType { - infix fun op(arg: Int) {} -} - -fun safeB(p: SafeType?) { - val v = p!! op 42 -} diff --git a/idea/testData/quickfix/expressions/fixNullableIterableWithExclExcl.kt b/idea/testData/quickfix/expressions/fixNullableIterableWithExclExcl.kt deleted file mode 100644 index 5301cd62e10..00000000000 --- a/idea/testData/quickfix/expressions/fixNullableIterableWithExclExcl.kt +++ /dev/null @@ -1,6 +0,0 @@ -// "Add non-null asserted (!!) call" "true" -fun foo() { - val test : Collection? = null!! - for (i in test) { } -} - diff --git a/idea/testData/quickfix/expressions/fixNullableIterableWithExclExcl.kt.after b/idea/testData/quickfix/expressions/fixNullableIterableWithExclExcl.kt.after deleted file mode 100644 index fd82e0d5ddf..00000000000 --- a/idea/testData/quickfix/expressions/fixNullableIterableWithExclExcl.kt.after +++ /dev/null @@ -1,6 +0,0 @@ -// "Add non-null asserted (!!) call" "true" -fun foo() { - val test : Collection? = null!! - for (i in test!!) { } -} - diff --git a/idea/testData/quickfix/expressions/fixNullableUnaryWithExclExcl.kt b/idea/testData/quickfix/expressions/fixNullableUnaryWithExclExcl.kt deleted file mode 100644 index 5d68ef20ca0..00000000000 --- a/idea/testData/quickfix/expressions/fixNullableUnaryWithExclExcl.kt +++ /dev/null @@ -1,9 +0,0 @@ -// "Add non-null asserted (!!) call" "true" - -class SafeType { - operator fun unaryMinus() {} -} - -fun safeB(p: SafeType?) { - val v = -p -} diff --git a/idea/testData/quickfix/expressions/fixNullableUnaryWithExclExcl.kt.after b/idea/testData/quickfix/expressions/fixNullableUnaryWithExclExcl.kt.after deleted file mode 100644 index 8a09c7a1464..00000000000 --- a/idea/testData/quickfix/expressions/fixNullableUnaryWithExclExcl.kt.after +++ /dev/null @@ -1,9 +0,0 @@ -// "Add non-null asserted (!!) call" "true" - -class SafeType { - operator fun unaryMinus() {} -} - -fun safeB(p: SafeType?) { - val v = -p!! -} diff --git a/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java index 7698c12f7c9..6f62b4ffcb6 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java @@ -687,11 +687,26 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest { runTest("idea/testData/quickfix/addExclExclCall/iterable.kt"); } + @TestMetadata("iterableDoesNotInheritIterableInterface.kt") + public void testIterableDoesNotInheritIterableInterface() throws Exception { + runTest("idea/testData/quickfix/addExclExclCall/iterableDoesNotInheritIterableInterface.kt"); + } + + @TestMetadata("iterableGeneric.kt") + public void testIterableGeneric() throws Exception { + runTest("idea/testData/quickfix/addExclExclCall/iterableGeneric.kt"); + } + @TestMetadata("iterableInExtension.kt") public void testIterableInExtension() throws Exception { runTest("idea/testData/quickfix/addExclExclCall/iterableInExtension.kt"); } + @TestMetadata("iterableWithBadIterator.kt") + public void testIterableWithBadIterator() throws Exception { + runTest("idea/testData/quickfix/addExclExclCall/iterableWithBadIterator.kt"); + } + @TestMetadata("normal.kt") public void testNormal() throws Exception { runTest("idea/testData/quickfix/addExclExclCall/normal.kt"); @@ -712,16 +727,16 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest { runTest("idea/testData/quickfix/addExclExclCall/nullExpression.kt"); } + @TestMetadata("operationBinary.kt") + public void testOperationBinary() throws Exception { + runTest("idea/testData/quickfix/addExclExclCall/operationBinary.kt"); + } + @TestMetadata("operationIn.kt") public void testOperationIn() throws Exception { runTest("idea/testData/quickfix/addExclExclCall/operationIn.kt"); } - @TestMetadata("operationPlus.kt") - public void testOperationPlus() throws Exception { - runTest("idea/testData/quickfix/addExclExclCall/operationPlus.kt"); - } - @TestMetadata("operationUnary.kt") public void testOperationUnary() throws Exception { runTest("idea/testData/quickfix/addExclExclCall/operationUnary.kt"); @@ -7715,41 +7730,6 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/testData/quickfix/expressions"), Pattern.compile("^([\\w\\-_]+)\\.kt$"), null, true); } - @TestMetadata("fixNullableBinaryWithExclExcl.kt") - public void testFixNullableBinaryWithExclExcl() throws Exception { - runTest("idea/testData/quickfix/expressions/fixNullableBinaryWithExclExcl.kt"); - } - - @TestMetadata("fixNullableInfixWithExclExcl.kt") - public void testFixNullableInfixWithExclExcl() throws Exception { - runTest("idea/testData/quickfix/expressions/fixNullableInfixWithExclExcl.kt"); - } - - @TestMetadata("fixNullableIterableGenericWithExclExcl.kt") - public void testFixNullableIterableGenericWithExclExcl() throws Exception { - runTest("idea/testData/quickfix/expressions/fixNullableIterableGenericWithExclExcl.kt"); - } - - @TestMetadata("fixNullableIterableWithExclExcl.kt") - public void testFixNullableIterableWithExclExcl() throws Exception { - runTest("idea/testData/quickfix/expressions/fixNullableIterableWithExclExcl.kt"); - } - - @TestMetadata("fixNullableUnaryWithExclExcl.kt") - public void testFixNullableUnaryWithExclExcl() throws Exception { - runTest("idea/testData/quickfix/expressions/fixNullableUnaryWithExclExcl.kt"); - } - - @TestMetadata("fixNullableWithExclExclAbsentWithBadIterator.kt") - public void testFixNullableWithExclExclAbsentWithBadIterator() throws Exception { - runTest("idea/testData/quickfix/expressions/fixNullableWithExclExclAbsentWithBadIterator.kt"); - } - - @TestMetadata("fixNullableWithIteratorWithExclExcl.kt") - public void testFixNullableWithIteratorWithExclExcl() throws Exception { - runTest("idea/testData/quickfix/expressions/fixNullableWithIteratorWithExclExcl.kt"); - } - @TestMetadata("kt11594.kt") public void testKt11594() throws Exception { runTest("idea/testData/quickfix/expressions/kt11594.kt");