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
12 lines
349 B
Kotlin
Vendored
12 lines
349 B
Kotlin
Vendored
// WITH_EXTENDED_CHECKERS
|
|
|
|
import <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>kotlin.jvm.functions.Function0<!>
|
|
|
|
val x: <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>Function0<Int><!> = <!INITIALIZER_TYPE_MISMATCH!>{ 42 }<!>
|
|
|
|
val y: Function1<String, String> = { it }
|
|
|
|
class MyFunction : Function2<Int, String, Unit> {
|
|
override fun invoke(p1: Int, p2: String) {}
|
|
}
|