[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
@@ -3,7 +3,7 @@ interface CPointed {
}
inline fun <reified T : CPointed> CPointed.reinterpret(): T {
TODO()
return TODO()
}
class CInt32VarX<T : Any?> : CPointed {
@@ -18,7 +18,7 @@ class CInt32VarX<T : Any?> : CPointed {
typealias CInt32Var = CInt32VarX<Int>
var <T_INT : Int> CInt32VarX<T_INT>.value: T_INT
get(): T_INT {
TODO()
return TODO()
}
set(value: T_INT) {
}
@@ -18,7 +18,8 @@ FILE fqName:<root> fileName:/integerCoercionToT.kt
TYPE_PARAMETER name:T index:0 variance: superTypes:[<root>.CPointed]
$receiver: VALUE_PARAMETER name:<this> type:<root>.CPointed
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 reinterpret <T> (): T of <root>.reinterpret [inline] declared in <root>'
CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null
CLASS CLASS name:CInt32VarX modality:FINAL visibility:public superTypes:[<root>.CPointed]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.CInt32VarX<T of <root>.CInt32VarX>
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?]
@@ -46,7 +47,8 @@ FILE fqName:<root> fileName:/integerCoercionToT.kt
TYPE_PARAMETER name:T_INT index:0 variance: superTypes:[kotlin.Int]
$receiver: VALUE_PARAMETER name:<this> type:<root>.CInt32VarX<T_INT of <root>.<get-value>>
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 <get-value> <T_INT> (): T_INT of <root>.<get-value> declared in <root>'
CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null
FUN name:<set-value> visibility:public modality:FINAL <T_INT> ($receiver:<root>.CInt32VarX<T_INT of <root>.<set-value>>, value:T_INT of <root>.<set-value>) returnType:kotlin.Unit
correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var]
TYPE_PARAMETER name:T_INT index:0 variance: superTypes:[kotlin.Int]
@@ -1,20 +0,0 @@
fun <X : Any?, Y : Any?> foo(): Function1<X, Y> {
return TODO()
}
interface Inv2<A : Any?, B : Any?> {
}
fun <T : Any?, R : Any?> check(x: T, y: R, f: Function1<T, R>): Inv2<T, R> {
return TODO()
}
fun test(): Inv2<String, Int> {
return check<String, Int>(x = "", y = 1, f = foo<String, Int>())
}
fun box(): String {
val x: Inv2<String, Int> = test()
return "OK"
}
@@ -1,50 +0,0 @@
FILE fqName:<root> fileName:/fixationOrder1.kt
FUN name:foo visibility:public modality:FINAL <X, Y> () returnType:kotlin.Function1<X of <root>.foo, Y of <root>.foo>
TYPE_PARAMETER name:X index:0 variance: superTypes:[kotlin.Any?]
TYPE_PARAMETER name:Y index:1 variance: superTypes:[kotlin.Any?]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun foo <X, Y> (): kotlin.Function1<X of <root>.foo, Y of <root>.foo> declared in <root>'
CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null
CLASS INTERFACE name:Inv2 modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Inv2<A of <root>.Inv2, B of <root>.Inv2>
TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?]
TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?]
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:check visibility:public modality:FINAL <T, R> (x:T of <root>.check, y:R of <root>.check, f:kotlin.Function1<T of <root>.check, R of <root>.check>) returnType:<root>.Inv2<T of <root>.check, R of <root>.check>
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?]
TYPE_PARAMETER name:R index:1 variance: superTypes:[kotlin.Any?]
VALUE_PARAMETER name:x index:0 type:T of <root>.check
VALUE_PARAMETER name:y index:1 type:R of <root>.check
VALUE_PARAMETER name:f index:2 type:kotlin.Function1<T of <root>.check, R of <root>.check>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun check <T, R> (x: T of <root>.check, y: R of <root>.check, f: kotlin.Function1<T of <root>.check, R of <root>.check>): <root>.Inv2<T of <root>.check, R of <root>.check> declared in <root>'
CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null
FUN name:test visibility:public modality:FINAL <> () returnType:<root>.Inv2<kotlin.String, kotlin.Int>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test (): <root>.Inv2<kotlin.String, kotlin.Int> declared in <root>'
CALL 'public final fun check <T, R> (x: T of <root>.check, y: R of <root>.check, f: kotlin.Function1<T of <root>.check, R of <root>.check>): <root>.Inv2<T of <root>.check, R of <root>.check> declared in <root>' type=<root>.Inv2<kotlin.String, kotlin.Int> origin=null
<T>: kotlin.String
<R>: kotlin.Int
x: CONST String type=kotlin.String value=""
y: CONST Int type=kotlin.Int value=1
f: CALL 'public final fun foo <X, Y> (): kotlin.Function1<X of <root>.foo, Y of <root>.foo> declared in <root>' type=kotlin.Function1<kotlin.String, kotlin.Int> origin=null
<X>: kotlin.String
<Y>: kotlin.Int
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
BLOCK_BODY
VAR name:x type:<root>.Inv2<kotlin.String, kotlin.Int> [val]
CALL 'public final fun test (): <root>.Inv2<kotlin.String, kotlin.Int> declared in <root>' type=<root>.Inv2<kotlin.String, kotlin.Int> origin=null
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
CONST String type=kotlin.String value="OK"
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
fun <X, Y> foo(): (X) -> Y = TODO()
interface Inv2<A, B>
@@ -1,5 +1,5 @@
fun <X : Any?, Y : Any?> foo(): Function1<X, Y> {
TODO()
return TODO()
}
interface Inv2<A : Any?, B : Any?> {
@@ -7,7 +7,7 @@ interface Inv2<A : Any?, B : Any?> {
}
fun <T : Any?, R : Any?> check(x: T, y: R, f: Function1<T, R>): Inv2<T, R> {
TODO()
return TODO()
}
fun test(): Inv2<String, Int> {
@@ -3,7 +3,8 @@ FILE fqName:<root> fileName:/fixationOrder1.kt
TYPE_PARAMETER name:X index:0 variance: superTypes:[kotlin.Any?]
TYPE_PARAMETER name:Y index:1 variance: superTypes:[kotlin.Any?]
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 foo <X, Y> (): kotlin.Function1<X of <root>.foo, Y of <root>.foo> declared in <root>'
CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null
CLASS INTERFACE name:Inv2 modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Inv2<A of <root>.Inv2, B of <root>.Inv2>
TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?]
@@ -28,7 +29,8 @@ FILE fqName:<root> fileName:/fixationOrder1.kt
VALUE_PARAMETER name:y index:1 type:R of <root>.check
VALUE_PARAMETER name:f index:2 type:kotlin.Function1<T of <root>.check, R of <root>.check>
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 check <T, R> (x: T of <root>.check, y: R of <root>.check, f: kotlin.Function1<T of <root>.check, R of <root>.check>): <root>.Inv2<T of <root>.check, R of <root>.check> declared in <root>'
CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null
FUN name:test visibility:public modality:FINAL <> () returnType:<root>.Inv2<kotlin.String, kotlin.Int>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test (): <root>.Inv2<kotlin.String, kotlin.Int> declared in <root>'