[FIR] Support deserialization of value parameter annotations

There are still some problems, see KT-39837
This commit is contained in:
Dmitriy Novozhilov
2020-06-25 18:26:01 +03:00
parent 2b2f9b3386
commit 7834284bec
22 changed files with 191 additions and 96 deletions
@@ -0,0 +1,19 @@
fun test_1() {
val list = buildList {
add("")
}
takeList(list)
}
fun test_2() {
val list = myBuildList {
add("")
}
takeList(list)
}
fun <E> myBuildList(@BuilderInference builderAction: MutableList<E>.() -> Unit): List<E> {
return ArrayList<E>().apply(builderAction)
}
fun takeList(list: List<String>) {}
@@ -0,0 +1,20 @@
FILE: builderInferenceFromStdlib.kt
public final fun test_1(): R|kotlin/Unit| {
lval list: R|kotlin/collections/List<kotlin/String>| = R|kotlin/collections/buildList|<R|kotlin/String|>(<L> = buildList@fun R|kotlin/collections/MutableList<kotlin/String>|.<anonymous>(): R|kotlin/Unit| <kind=EXACTLY_ONCE> {
^ this@R|special/anonymous|.R|FakeOverride<kotlin/collections/MutableList.add: R|kotlin/Boolean|>|(String())
}
)
R|/takeList|(R|<local>/list|)
}
public final fun test_2(): R|kotlin/Unit| {
lval list: R|kotlin/collections/List<kotlin/String>| = R|/myBuildList|<R|kotlin/String|>(<L> = myBuildList@fun R|kotlin/collections/MutableList<kotlin/String>|.<anonymous>(): R|kotlin/Unit| {
^ this@R|special/anonymous|.R|FakeOverride<kotlin/collections/MutableList.add: R|kotlin/Boolean|>|(String())
}
)
R|/takeList|(R|<local>/list|)
}
public final fun <E> myBuildList(@R|kotlin/BuilderInference|() builderAction: R|kotlin/collections/MutableList<E>.() -> kotlin/Unit|): R|kotlin/collections/List<E>| {
^myBuildList R|java/util/ArrayList.ArrayList|<R|E|>().R|kotlin/apply|<R|java/util/ArrayList<E>|>(R|<local>/builderAction|)
}
public final fun takeList(list: R|kotlin/collections/List<kotlin/String>|): R|kotlin/Unit| {
}