Add test for KT-40412
This commit is contained in:
Generated
+5
@@ -10028,6 +10028,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/extensionPropertyAndExtensionGetValue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("functionRefDelefate.kt")
|
||||
public void testFunctionRefDelefate() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/functionRefDelefate.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("genericDelegate.kt")
|
||||
public void testGenericDelegate() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/genericDelegate.kt");
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
// KT-40412
|
||||
|
||||
// WITH_RUNTIME
|
||||
|
||||
// MODULE: lib
|
||||
// FILE: lib.kt
|
||||
|
||||
import kotlin.properties.ReadOnlyProperty
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
var result = "FAIL"
|
||||
|
||||
class CaptureContext<A>(val capture: (A) -> Unit) : ReadOnlyProperty<A, () -> Unit> {
|
||||
override fun getValue(thisRef: A, property: KProperty<*>) = { -> capture(thisRef) }
|
||||
}
|
||||
operator fun <A> ((A) -> Unit).provideDelegate(thisRef: A, property: KProperty<*>) = CaptureContext(this)
|
||||
|
||||
fun right(arg: Right) { result = "OK" }
|
||||
class Right { val prop: () -> Unit by ::right }
|
||||
|
||||
// MODULE: main(lib)
|
||||
// FILE: main.kt
|
||||
|
||||
fun box(): String {
|
||||
val r = Right()
|
||||
r.prop()
|
||||
return result
|
||||
}
|
||||
+5
@@ -11428,6 +11428,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/extensionPropertyAndExtensionGetValue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("functionRefDelefate.kt")
|
||||
public void testFunctionRefDelefate() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/functionRefDelefate.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("genericDelegate.kt")
|
||||
public void testGenericDelegate() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/genericDelegate.kt");
|
||||
|
||||
+5
@@ -11433,6 +11433,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/extensionPropertyAndExtensionGetValue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("functionRefDelefate.kt")
|
||||
public void testFunctionRefDelefate() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/functionRefDelefate.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("genericDelegate.kt")
|
||||
public void testGenericDelegate() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/genericDelegate.kt");
|
||||
|
||||
+5
@@ -10028,6 +10028,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/extensionPropertyAndExtensionGetValue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("functionRefDelefate.kt")
|
||||
public void testFunctionRefDelefate() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/functionRefDelefate.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("genericDelegate.kt")
|
||||
public void testGenericDelegate() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/genericDelegate.kt");
|
||||
|
||||
Generated
+5
@@ -8543,6 +8543,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/extensionPropertyAndExtensionGetValue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("functionRefDelefate.kt")
|
||||
public void testFunctionRefDelefate() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/functionRefDelefate.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("genericDelegate.kt")
|
||||
public void testGenericDelegate() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/genericDelegate.kt");
|
||||
|
||||
Generated
+5
@@ -8543,6 +8543,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/extensionPropertyAndExtensionGetValue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("functionRefDelefate.kt")
|
||||
public void testFunctionRefDelefate() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/functionRefDelefate.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("genericDelegate.kt")
|
||||
public void testGenericDelegate() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/genericDelegate.kt");
|
||||
|
||||
+5
@@ -8543,6 +8543,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/extensionPropertyAndExtensionGetValue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("functionRefDelefate.kt")
|
||||
public void testFunctionRefDelefate() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/functionRefDelefate.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("genericDelegate.kt")
|
||||
public void testGenericDelegate() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/genericDelegate.kt");
|
||||
|
||||
Reference in New Issue
Block a user