Introduce Property: Add test for name clash in the presence of anonymous initializer (was failing before ElementResolver fix)
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
// EXTRACTION_TARGET: property with initializer
|
||||
|
||||
class A {
|
||||
val i: Int
|
||||
|
||||
{
|
||||
i = 1
|
||||
}
|
||||
|
||||
fun foo(): Int {
|
||||
return <selection>1 + 2</selection>
|
||||
}
|
||||
}
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
// EXTRACTION_TARGET: property with initializer
|
||||
|
||||
class A {
|
||||
val i: Int
|
||||
|
||||
{
|
||||
i = 1
|
||||
}
|
||||
|
||||
private val i1 = 1 + 2
|
||||
|
||||
fun foo(): Int {
|
||||
return i1
|
||||
}
|
||||
}
|
||||
|
||||
+6
@@ -1965,6 +1965,12 @@ public class JetExtractionTestGenerated extends AbstractJetExtractionTest {
|
||||
doIntroducePropertyTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("extractToClassWithNameClashAndAnonymousInitializer.kt")
|
||||
public void testExtractToClassWithNameClashAndAnonymousInitializer() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/refactoring/introduceProperty/extractToClassWithNameClashAndAnonymousInitializer.kt");
|
||||
doIntroducePropertyTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("extractToFileWithNameClash.kt")
|
||||
public void testExtractToFileWithNameClash() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/refactoring/introduceProperty/extractToFileWithNameClash.kt");
|
||||
|
||||
Reference in New Issue
Block a user