FIR: Fix incorrect type of block generated for inc operator
Previously, it was obtained from expected type of a variable being assigned,
but it's better to use the type of resulting expression
Initially this part was brought in 4ab0897d7d,
but as we see in commit message and tests it was all about unit-coercion
This commit is contained in:
committed by
teamcityserver
parent
a7859e0332
commit
c0b6a593e0
@@ -11,5 +11,4 @@ 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
|
||||
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
|
||||
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? {
|
||||
return Unit
|
||||
Unit
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user