FIR: fix return statement generation for Unit-returning lambdas...

for case then the expected return type is not Unit.
#KT-56747 fixed
This commit is contained in:
Ilya Chernikov
2023-03-20 11:59:23 +01:00
committed by Space Team
parent 505edb9746
commit aa3c189d83
5 changed files with 8 additions and 4 deletions
@@ -11,4 +11,5 @@ FILE fqName:<root> fileName:/lambdaReturningUnit.kt
block: FUN_EXPR type=kotlin.Function0<kotlin.Any?> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:kotlin.Any?
BLOCK_BODY
GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.Any? declared in <root>.box'
GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit
@@ -4,7 +4,7 @@ inline fun flaf(block: Function0<Any?>) {
suspend fun box() {
flaf(block = local fun <anonymous>(): Any? {
Unit
return Unit
}
)
}