Inline val: more correct and simple detection of write usages

#KT-17489 Fixed
This commit is contained in:
Valentin Kipyatkov
2017-05-22 19:21:44 +03:00
parent 55979aca74
commit 940ce27925
8 changed files with 69 additions and 34 deletions
@@ -539,6 +539,12 @@ public class InlineTestGenerated extends AbstractInlineTest {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/refactoring/inline/inlineVariableOrProperty"), Pattern.compile("^(\\w+)\\.kt$"), TargetBackend.ANY, true);
}
@TestMetadata("AppendToCollection.kt")
public void testAppendToCollection() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/refactoring/inline/inlineVariableOrProperty/AppendToCollection.kt");
doTest(fileName);
}
@TestMetadata("Basic.kt")
public void testBasic() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/refactoring/inline/inlineVariableOrProperty/Basic.kt");
@@ -1000,6 +1006,12 @@ public class InlineTestGenerated extends AbstractInlineTest {
doTest(fileName);
}
@TestMetadata("KT17489.kt")
public void testKT17489() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/refactoring/inline/inlineVariableOrProperty/property/KT17489.kt");
doTest(fileName);
}
@TestMetadata("keepImport.kt")
public void testKeepImport() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/refactoring/inline/inlineVariableOrProperty/property/keepImport.kt");