[FE 1.0] Always create return value for CallInstruction

This fixes missing `USED_AS_EXPRESSION` recordings
^KT-47527 Fixed
This commit is contained in:
Dmitriy Novozhilov
2021-06-30 16:40:55 +03:00
committed by TeamCityServer
parent b2372ff0b9
commit ae608ea67f
50 changed files with 496 additions and 204 deletions
@@ -1,11 +0,0 @@
fun <R : Number> Number.convert(): R {
return TODO()
}
fun foo(arg: Number) {
}
fun main(args: Array<String>) {
val x: Int = 0
foo(arg = x.convert<Number>())
}
@@ -1,19 +0,0 @@
FILE fqName:<root> fileName:/argumentMappedWithError.kt
FUN name:convert visibility:public modality:FINAL <R> ($receiver:kotlin.Number) returnType:R of <root>.convert
TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Number]
$receiver: VALUE_PARAMETER name:<this> type:kotlin.Number
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun convert <R> (): R of <root>.convert declared in <root>'
CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null
FUN name:foo visibility:public modality:FINAL <> (arg:kotlin.Number) returnType:kotlin.Unit
VALUE_PARAMETER name:arg index:0 type:kotlin.Number
BLOCK_BODY
FUN name:main visibility:public modality:FINAL <> (args:kotlin.Array<kotlin.String>) returnType:kotlin.Unit
VALUE_PARAMETER name:args index:0 type:kotlin.Array<kotlin.String>
BLOCK_BODY
VAR name:x type:kotlin.Int [val]
CONST Int type=kotlin.Int value=0
CALL 'public final fun foo (arg: kotlin.Number): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
arg: CALL 'public final fun convert <R> (): R of <root>.convert declared in <root>' type=kotlin.Number origin=null
<R>: kotlin.Number
$receiver: GET_VAR 'val x: kotlin.Int [val] declared in <root>.main' type=kotlin.Int origin=null
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
fun <R : Number> Number.convert(): R = TODO()
fun foo(arg: Number) {
@@ -1,5 +1,5 @@
fun <R : Number> Number.convert(): R {
TODO()
return TODO()
}
fun foo(arg: Number) {
@@ -3,7 +3,8 @@ FILE fqName:<root> fileName:/argumentMappedWithError.kt
TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Number]
$receiver: VALUE_PARAMETER name:<this> type:kotlin.Number
BLOCK_BODY
CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null
RETURN type=kotlin.Nothing from='public final fun convert <R> (): R of <root>.convert declared in <root>'
CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null
FUN name:foo visibility:public modality:FINAL <> (arg:kotlin.Number) returnType:kotlin.Unit
VALUE_PARAMETER name:arg index:0 type:kotlin.Number
BLOCK_BODY