diff --git a/compiler/testData/codegen/box/properties/PrivatePropertyOfComplexGenericFunctionType.kt b/compiler/testData/codegen/box/properties/PrivatePropertyOfComplexGenericFunctionType.kt new file mode 100644 index 00000000000..7c1ea5a7497 --- /dev/null +++ b/compiler/testData/codegen/box/properties/PrivatePropertyOfComplexGenericFunctionType.kt @@ -0,0 +1,15 @@ +// ISSUE: KT-63654 +// WITH_STDLIB + +data class State(private val action: (S) -> Pair) { + fun flatMap(f: (A) -> State): State = + State { s0: S -> + val (a, s1) = action(s0) + f(a).action(s1) + } +} + +fun box(): String { + State { 42 to "" }.flatMap { i -> State { i.toLong() to "" } } + return "OK" +} diff --git a/compiler/testData/codegen/box/properties/PrivatePropertyOfGenericContravariantFunctionType.kt b/compiler/testData/codegen/box/properties/PrivatePropertyOfGenericContravariantFunctionType.kt new file mode 100644 index 00000000000..35dcfb338bf --- /dev/null +++ b/compiler/testData/codegen/box/properties/PrivatePropertyOfGenericContravariantFunctionType.kt @@ -0,0 +1,12 @@ +// ISSUE: KT-63654 + +class Klass(private val action: (A) -> Unit) { + fun execute(value: B, klassB: Klass) { + klassB.action(value) + } +} + +fun box(): String { + Klass { a: Int -> a.inc() }.execute("", Klass { b: String -> b.length }) + return "OK" +} diff --git a/compiler/testData/codegen/box/properties/PrivatePropertyOfGenericCovariantFunctionType.kt b/compiler/testData/codegen/box/properties/PrivatePropertyOfGenericCovariantFunctionType.kt new file mode 100644 index 00000000000..06df480b294 --- /dev/null +++ b/compiler/testData/codegen/box/properties/PrivatePropertyOfGenericCovariantFunctionType.kt @@ -0,0 +1,12 @@ +// ISSUE: KT-63654 + +class Klass(private val action: () -> A) { + fun execute(klassB: Klass) { + klassB.action() + } +} + +fun box(): String { + Klass { 42 }.execute(Klass { "" }) + return "OK" +}