c0b6a593e0
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
28 lines
655 B
Plaintext
Vendored
28 lines
655 B
Plaintext
Vendored
val test1: Function0<Unit>
|
|
field = local fun <anonymous>() {
|
|
42 /*~> Unit */
|
|
}
|
|
|
|
get
|
|
|
|
fun test2(mc: MutableCollection<String>) {
|
|
mc.add(element = "") /*~> Unit */
|
|
}
|
|
|
|
fun test3() {
|
|
{ // BLOCK
|
|
val tmp0_safe_receiver: @FlexibleNullability PrintStream? = #out
|
|
when {
|
|
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
|
|
else -> tmp0_safe_receiver.println(p0 = "Hello,")
|
|
}
|
|
} /*~> Unit */
|
|
{ // BLOCK
|
|
val tmp1_safe_receiver: @FlexibleNullability PrintStream? = #out
|
|
when {
|
|
EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null
|
|
else -> tmp1_safe_receiver.println(p0 = "world!")
|
|
}
|
|
} /*~> Unit */
|
|
}
|