mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Introduce Property: Forbid extension properties with initializers and lazy
ones GitOrigin-RevId: 75d88fb2229d051f996ab6f1a334e5874945f716
This commit is contained in:
committed by
intellij-monorepo-bot
parent
0d6b074641
commit
b67e9cdd2d
+2
@@ -326,6 +326,7 @@ enum class ExtractionTarget(val name: String) {
|
||||
&& checkSimpleControlFlow(descriptor)
|
||||
&& checkSimpleBody(descriptor)
|
||||
&& checkNotTrait(descriptor)
|
||||
&& descriptor.receiverParameter == null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -340,6 +341,7 @@ enum class ExtractionTarget(val name: String) {
|
||||
return checkSignatureAndParent(descriptor)
|
||||
&& checkSimpleControlFlow(descriptor)
|
||||
&& checkNotTrait(descriptor)
|
||||
&& descriptor.receiverParameter == null
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+12
@@ -2053,6 +2053,12 @@ public class JetExtractionTestGenerated extends AbstractJetExtractionTest {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/refactoring/introduceProperty"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("extractExtensionWithInitializer.kt")
|
||||
public void testExtractExtensionWithInitializer() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/refactoring/introduceProperty/extractExtensionWithInitializer.kt");
|
||||
doIntroducePropertyTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("extractFromDefaultValueInConstructor.kt")
|
||||
public void testExtractFromDefaultValueInConstructor() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/refactoring/introduceProperty/extractFromDefaultValueInConstructor.kt");
|
||||
@@ -2065,6 +2071,12 @@ public class JetExtractionTestGenerated extends AbstractJetExtractionTest {
|
||||
doIntroducePropertyTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("extractLazyExtension.kt")
|
||||
public void testExtractLazyExtension() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/refactoring/introduceProperty/extractLazyExtension.kt");
|
||||
doIntroducePropertyTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("extractLazyMultipleExpressions.kt")
|
||||
public void testExtractLazyMultipleExpressions() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/refactoring/introduceProperty/extractLazyMultipleExpressions.kt");
|
||||
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// EXTRACTION_TARGET: property with initializer
|
||||
// SIBLING:
|
||||
class A(val a: Int){
|
||||
fun foo() = <selection>a + 1</selection>
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
Can't generate property with initializer: a + 1
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// EXTRACTION_TARGET: lazy property
|
||||
// SIBLING:
|
||||
class A(val a: Int){
|
||||
fun foo() = <selection>a + 1</selection>
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
Can't generate lazy property: a + 1
|
||||
Reference in New Issue
Block a user