KT-51475 Add a test
This commit is contained in:
committed by
Space Team
parent
57ddb9fddf
commit
a4bde57d44
+6
@@ -17474,6 +17474,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
|||||||
runTest("compiler/testData/codegen/box/extensionFunctions/contextReceivers/kt51284.kt");
|
runTest("compiler/testData/codegen/box/extensionFunctions/contextReceivers/kt51284.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt51475.kt")
|
||||||
|
public void testKt51475() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/extensionFunctions/contextReceivers/kt51475.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt51863.kt")
|
@TestMetadata("kt51863.kt")
|
||||||
public void testKt51863() throws Exception {
|
public void testKt51863() throws Exception {
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
// !LANGUAGE: +ContextReceivers
|
||||||
|
// TARGET_BACKEND: JVM_IR
|
||||||
|
// WITH_STDLIB
|
||||||
|
// !OPT_IN: kotlin.contracts.ExperimentalContracts
|
||||||
|
|
||||||
|
import kotlin.contracts.*
|
||||||
|
|
||||||
|
class Smth {
|
||||||
|
val whatever: Int
|
||||||
|
|
||||||
|
init {
|
||||||
|
calculate { whatever = it }
|
||||||
|
}
|
||||||
|
|
||||||
|
context(Any)
|
||||||
|
inline fun calculate(block: (Int) -> Unit) {
|
||||||
|
contract {
|
||||||
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
val s = Smth()
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
+6
@@ -17474,6 +17474,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
runTest("compiler/testData/codegen/box/extensionFunctions/contextReceivers/kt51284.kt");
|
runTest("compiler/testData/codegen/box/extensionFunctions/contextReceivers/kt51284.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt51475.kt")
|
||||||
|
public void testKt51475() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/extensionFunctions/contextReceivers/kt51475.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt51863.kt")
|
@TestMetadata("kt51863.kt")
|
||||||
public void testKt51863() throws Exception {
|
public void testKt51863() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user