Files
kotlin-fork/compiler/fir/analysis-tests/testData/resolveWithStdlib/functionX.kt
T
Denis.Zharkov c0b6a593e0 FIR: Fix incorrect type of block generated for inc operator
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
2021-11-26 19:39:38 +03:00

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) {}
}