[PL] Fix: Respect inlined array constructor lambdas

This commit is contained in:
Dmitriy Dolovov
2023-03-23 17:11:34 +01:00
committed by Space Team
parent 5baeae3bfd
commit 66532d714e
4 changed files with 33 additions and 3 deletions
@@ -161,3 +161,21 @@ fun newNonInlineFunctionInOpenClassImpl(oci: OpenClassImpl, x: Int): String = oc
fun inlineLambdaToNoinlineLambda(x: Int): String = Functions.inlineLambdaToNoinlineLambda(x) { if (it > 0) it.toString() else return "inlineLambdaToNoinlineLambda($x)" }
fun inlineLambdaToCrossinlineLambda(x: Int): String = Functions.inlineLambdaToCrossinlineLambda(x) { if (it > 0) it.toString() else return "inlineLambdaToCrossinlineLambda($x)" }
fun nonLocalReturnFromArrayConstructorLambda(expected: String, unexpected: String): String = Array(1) outer@{
Array(1) {
if ('1' in "123") { // The condition that is always true.
return@outer expected
}
unexpected
}[0]
}[0]
fun nonLocalReturnFromIntArrayConstructorLambda(expected: Int, unexpected: Int): Int = IntArray(1) outer@{
IntArray(1) {
if ('1' in "123") { // The condition that is always true.
return@outer expected
}
unexpected
}[0]
}[0]