c5893913f3
Coersion to Unit from error type leads to misleading type mismatches: "expected <expected lambda return type> found Unit", despite no user-provided Unit / empty lambda. These diagnostics were collected, but not reported before, and that had been disguising the issue for a while. KT-34729 Fixed
21 lines
233 B
Kotlin
Vendored
21 lines
233 B
Kotlin
Vendored
// !WITH_NEW_INFERENCE
|
|
|
|
class B
|
|
|
|
class A {
|
|
operator fun B.invoke() {}
|
|
}
|
|
|
|
val B.a: () -> Int get() = { 5 }
|
|
|
|
fun test(a: A, b: B) {
|
|
val x: Int = b.a()
|
|
|
|
b.(a)()
|
|
|
|
with(b) {
|
|
val y: Int = a()
|
|
(a)()
|
|
}
|
|
}
|