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
20 lines
386 B
Kotlin
Vendored
20 lines
386 B
Kotlin
Vendored
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
|
// !WITH_NEW_INFERENCE
|
|
|
|
interface JPAEntityClass<D> {
|
|
fun <T> T.findByName(s: String): D {null!!}
|
|
}
|
|
|
|
class Foo {
|
|
companion object : JPAEntityClass<Foo>
|
|
}
|
|
|
|
fun main() {
|
|
<!NI;NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>with<!>("", {
|
|
Foo.<!UNRESOLVED_REFERENCE!>findByName<!>("")
|
|
})
|
|
with(Foo) {
|
|
findByName("")
|
|
}
|
|
}
|