[FIR] Don't constraints for return expressions of lambda if it has Unit return type

This commit is contained in:
Dmitriy Novozhilov
2020-09-11 15:38:04 +03:00
parent 8e0d0d2fd8
commit def647c094
5 changed files with 34 additions and 4 deletions
@@ -0,0 +1,9 @@
class DropDownComponent<T : Any>(val initialValues: List<T>)
fun test(strings: List<String>) {
val dropDown = DropDownComponent(
initialValues = buildList {
addAll(strings)
}
)
}
@@ -0,0 +1,16 @@
FILE: builderInferenceAndCoercionToUnit.kt
public final class DropDownComponent<T : R|kotlin/Any|> : R|kotlin/Any| {
public constructor<T : R|kotlin/Any|>(initialValues: R|kotlin/collections/List<T>|): R|DropDownComponent<T>| {
super<R|kotlin/Any|>()
}
public final val initialValues: R|kotlin/collections/List<T>| = R|<local>/initialValues|
public get(): R|kotlin/collections/List<T>|
}
public final fun test(strings: R|kotlin/collections/List<kotlin/String>|): R|kotlin/Unit| {
lval dropDown: R|DropDownComponent<kotlin/String>| = R|/DropDownComponent.DropDownComponent|<R|kotlin/String|>(initialValues = 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.addAll: R|kotlin/Boolean|>|(R|<local>/strings|)
}
))
}