[tests] Add test data for KT-53553

This commit is contained in:
Stanislav Ruban
2023-12-02 15:24:39 +01:00
committed by Space Team
parent 982e8133ba
commit 9dd3cf7bfc
3 changed files with 112 additions and 0 deletions
@@ -0,0 +1,42 @@
// ISSUE: KT-53553
// IGNORE_LIGHT_ANALYSIS
// IGNORE_BACKEND: ANY
// REASON: red code (see corresponding diagnostic test)
fun box(): String {
val buildee = parallelBuild(
{
consumeTargetTypeBase(it)
},
{
consumeTargetType(it)
}
)
consumeTargetTypeBuildee(buildee)
return "OK"
}
open class TargetTypeBase
class TargetType: TargetTypeBase()
fun consumeTargetTypeBase(value: TargetTypeBase) {}
fun consumeTargetType(value: TargetType) {}
fun consumeTargetTypeBuildee(value: Buildee<TargetType>) {}
class Buildee<TV>
fun <PTV> parallelBuild(
instructionsA: Buildee<PTV>.(PTV) -> Unit,
instructionsB: Buildee<PTV>.(PTV) -> Unit
): Buildee<PTV> {
val value = TargetType() as PTV
return Buildee<PTV>().apply {
instructionsA(value)
instructionsB(value)
}
}