diff --git a/idea/testData/quickfix/typeMismatch/variableInitializedWithNullProperty.kt b/idea/testData/quickfix/typeMismatch/variableInitializedWithNullProperty.kt new file mode 100644 index 00000000000..ddb3784df28 --- /dev/null +++ b/idea/testData/quickfix/typeMismatch/variableInitializedWithNullProperty.kt @@ -0,0 +1,10 @@ +// "Change type of 'Foo.x' to 'String?'" "true" +class Foo { + var x = null + + fun foo(condition: Boolean) { + if (condition) { + x = "abc" + } + } +} \ No newline at end of file diff --git a/idea/testData/quickfix/typeMismatch/variableInitializedWithNullProperty.kt.after b/idea/testData/quickfix/typeMismatch/variableInitializedWithNullProperty.kt.after new file mode 100644 index 00000000000..9ea86920b15 --- /dev/null +++ b/idea/testData/quickfix/typeMismatch/variableInitializedWithNullProperty.kt.after @@ -0,0 +1,10 @@ +// "Change type of 'Foo.x' to 'String?'" "true" +class Foo { + var x: String? = null + + fun foo(condition: Boolean) { + if (condition) { + x = "abc" + } + } +} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java index 40c97ff8a39..e651eba8be6 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java @@ -14278,6 +14278,11 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest { runTest("idea/testData/quickfix/typeMismatch/variableInitializedWithNull4.kt"); } + @TestMetadata("variableInitializedWithNullProperty.kt") + public void testVariableInitializedWithNullProperty() throws Exception { + runTest("idea/testData/quickfix/typeMismatch/variableInitializedWithNullProperty.kt"); + } + @TestMetadata("when.kt") public void testWhen() throws Exception { runTest("idea/testData/quickfix/typeMismatch/when.kt");