[LL FIR] AbstractInBlockModificationTest: add more tests
^KT-60518
This commit is contained in:
committed by
Space Team
parent
f0d8a1cbe9
commit
5f24ad114c
@@ -0,0 +1,9 @@
|
|||||||
|
import kotlin.contracts.InvocationKind
|
||||||
|
|
||||||
|
inline fun foo(block: () -> Unit) {
|
||||||
|
<expr>kotlin.contracts.contract {
|
||||||
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}</expr>
|
||||||
|
|
||||||
|
block()
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
IN-BLOCK MODIFICATION IS NOT APPLICABLE FOR THIS PLACE
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
// LOOK_UP_FOR_ELEMENT_OF_TYPE: org.jetbrains.kotlin.psi.KtBlockExpression
|
||||||
|
|
||||||
|
fun doo() <expr>{}</expr>
|
||||||
+6
@@ -0,0 +1,6 @@
|
|||||||
|
BEFORE MODIFICATION:
|
||||||
|
public final [ResolvedTo(BODY_RESOLVE)] fun doo(): R|kotlin/Unit| {
|
||||||
|
}
|
||||||
|
|
||||||
|
AFTER MODIFICATION:
|
||||||
|
public final [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] fun doo(): R|kotlin/Unit| { LAZY_BLOCK }
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
// LOOK_UP_FOR_ELEMENT_OF_TYPE: org.jetbrains.kotlin.psi.KtBlockExpression
|
||||||
|
|
||||||
|
val i: Int
|
||||||
|
get() <expr>{}</expr>
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
BEFORE MODIFICATION:
|
||||||
|
public final [ResolvedTo(BODY_RESOLVE)] val i: R|kotlin/Int|
|
||||||
|
public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/Int| {
|
||||||
|
}
|
||||||
|
|
||||||
|
AFTER MODIFICATION:
|
||||||
|
public final [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] val i: R|kotlin/Int|
|
||||||
|
public [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] get(): R|kotlin/Int| { LAZY_BLOCK }
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
// LOOK_UP_FOR_ELEMENT_OF_TYPE: org.jetbrains.kotlin.psi.KtConstantExpression
|
||||||
|
|
||||||
|
val i: Int = <expr>42</expr>
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
BEFORE MODIFICATION:
|
||||||
|
public final [ResolvedTo(BODY_RESOLVE)] val i: R|kotlin/Int| = Int(42)
|
||||||
|
public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/Int|
|
||||||
|
|
||||||
|
AFTER MODIFICATION:
|
||||||
|
public final [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] val i: R|kotlin/Int| = LAZY_EXPRESSION
|
||||||
|
public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/Int|
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
// LOOK_UP_FOR_ELEMENT_OF_TYPE: org.jetbrains.kotlin.psi.KtBlockExpression
|
||||||
|
|
||||||
|
var i: Int = 4
|
||||||
|
set(value) <expr>{}</expr>
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
BEFORE MODIFICATION:
|
||||||
|
public final [ResolvedTo(BODY_RESOLVE)] var i: R|kotlin/Int| = Int(4)
|
||||||
|
public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/Int|
|
||||||
|
public [ResolvedTo(BODY_RESOLVE)] set([ResolvedTo(BODY_RESOLVE)] value: R|kotlin/Int|): R|kotlin/Unit| {
|
||||||
|
}
|
||||||
|
|
||||||
|
AFTER MODIFICATION:
|
||||||
|
public final [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] var i: R|kotlin/Int| = Int(4)
|
||||||
|
public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/Int|
|
||||||
|
public [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] set([ResolvedTo(BODY_RESOLVE)] value: R|kotlin/Int|): R|kotlin/Unit| { LAZY_BLOCK }
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import kotlin.contracts.InvocationKind
|
||||||
|
|
||||||
|
inline fun foo(block: () -> Unit) {
|
||||||
|
kotlin.contracts.contract {
|
||||||
|
<expr>callsInPlace</expr>(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
|
|
||||||
|
block()
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
IN-BLOCK MODIFICATION IS NOT APPLICABLE FOR THIS PLACE
|
||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
class MyProducer {
|
||||||
|
fun produce(): Int = 4
|
||||||
|
}
|
||||||
|
|
||||||
|
fun MyProducer.testFun(param1: Int = <expr>produce</expr>()) {
|
||||||
|
42
|
||||||
|
}
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
IN-BLOCK MODIFICATION IS NOT APPLICABLE FOR THIS PLACE
|
||||||
+42
@@ -30,6 +30,36 @@ public class OutOfContentRootInBlockModificationTestGenerated extends AbstractOu
|
|||||||
runTest("analysis/low-level-api-fir/testdata/inBlockModification/contract.kt");
|
runTest("analysis/low-level-api-fir/testdata/inBlockModification/contract.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("entireContract.kt")
|
||||||
|
public void testEntireContract() throws Exception {
|
||||||
|
runTest("analysis/low-level-api-fir/testdata/inBlockModification/entireContract.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("entireFunctionBody.kt")
|
||||||
|
public void testEntireFunctionBody() throws Exception {
|
||||||
|
runTest("analysis/low-level-api-fir/testdata/inBlockModification/entireFunctionBody.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("entireGetterBody.kt")
|
||||||
|
public void testEntireGetterBody() throws Exception {
|
||||||
|
runTest("analysis/low-level-api-fir/testdata/inBlockModification/entireGetterBody.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("entireInitializer.kt")
|
||||||
|
public void testEntireInitializer() throws Exception {
|
||||||
|
runTest("analysis/low-level-api-fir/testdata/inBlockModification/entireInitializer.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("entireSetterBody.kt")
|
||||||
|
public void testEntireSetterBody() throws Exception {
|
||||||
|
runTest("analysis/low-level-api-fir/testdata/inBlockModification/entireSetterBody.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("extensionWithDefaultParameters.kt")
|
@TestMetadata("extensionWithDefaultParameters.kt")
|
||||||
public void testExtensionWithDefaultParameters() throws Exception {
|
public void testExtensionWithDefaultParameters() throws Exception {
|
||||||
@@ -42,6 +72,18 @@ public class OutOfContentRootInBlockModificationTestGenerated extends AbstractOu
|
|||||||
runTest("analysis/low-level-api-fir/testdata/inBlockModification/functionWithDefaultParameters.kt");
|
runTest("analysis/low-level-api-fir/testdata/inBlockModification/functionWithDefaultParameters.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("insideContract.kt")
|
||||||
|
public void testInsideContract() throws Exception {
|
||||||
|
runTest("analysis/low-level-api-fir/testdata/inBlockModification/insideContract.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("insideDefaultParameter.kt")
|
||||||
|
public void testInsideDefaultParameter() throws Exception {
|
||||||
|
runTest("analysis/low-level-api-fir/testdata/inBlockModification/insideDefaultParameter.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("memberFunWithBodyWithContract.kt")
|
@TestMetadata("memberFunWithBodyWithContract.kt")
|
||||||
public void testMemberFunWithBodyWithContract() throws Exception {
|
public void testMemberFunWithBodyWithContract() throws Exception {
|
||||||
|
|||||||
+42
@@ -30,6 +30,36 @@ public class SourceInBlockModificationTestGenerated extends AbstractSourceInBloc
|
|||||||
runTest("analysis/low-level-api-fir/testdata/inBlockModification/contract.kt");
|
runTest("analysis/low-level-api-fir/testdata/inBlockModification/contract.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("entireContract.kt")
|
||||||
|
public void testEntireContract() throws Exception {
|
||||||
|
runTest("analysis/low-level-api-fir/testdata/inBlockModification/entireContract.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("entireFunctionBody.kt")
|
||||||
|
public void testEntireFunctionBody() throws Exception {
|
||||||
|
runTest("analysis/low-level-api-fir/testdata/inBlockModification/entireFunctionBody.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("entireGetterBody.kt")
|
||||||
|
public void testEntireGetterBody() throws Exception {
|
||||||
|
runTest("analysis/low-level-api-fir/testdata/inBlockModification/entireGetterBody.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("entireInitializer.kt")
|
||||||
|
public void testEntireInitializer() throws Exception {
|
||||||
|
runTest("analysis/low-level-api-fir/testdata/inBlockModification/entireInitializer.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("entireSetterBody.kt")
|
||||||
|
public void testEntireSetterBody() throws Exception {
|
||||||
|
runTest("analysis/low-level-api-fir/testdata/inBlockModification/entireSetterBody.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("extensionWithDefaultParameters.kt")
|
@TestMetadata("extensionWithDefaultParameters.kt")
|
||||||
public void testExtensionWithDefaultParameters() throws Exception {
|
public void testExtensionWithDefaultParameters() throws Exception {
|
||||||
@@ -42,6 +72,18 @@ public class SourceInBlockModificationTestGenerated extends AbstractSourceInBloc
|
|||||||
runTest("analysis/low-level-api-fir/testdata/inBlockModification/functionWithDefaultParameters.kt");
|
runTest("analysis/low-level-api-fir/testdata/inBlockModification/functionWithDefaultParameters.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("insideContract.kt")
|
||||||
|
public void testInsideContract() throws Exception {
|
||||||
|
runTest("analysis/low-level-api-fir/testdata/inBlockModification/insideContract.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("insideDefaultParameter.kt")
|
||||||
|
public void testInsideDefaultParameter() throws Exception {
|
||||||
|
runTest("analysis/low-level-api-fir/testdata/inBlockModification/insideDefaultParameter.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("memberFunWithBodyWithContract.kt")
|
@TestMetadata("memberFunWithBodyWithContract.kt")
|
||||||
public void testMemberFunWithBodyWithContract() throws Exception {
|
public void testMemberFunWithBodyWithContract() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user