27c942a0ff
Its return type should be Unit, so do not use the expected type from, e.g., parameter type.
20 lines
379 B
Kotlin
Vendored
20 lines
379 B
Kotlin
Vendored
// !WITH_NEW_INFERENCE
|
|
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
|
// !LANGUAGE: +NewInference
|
|
|
|
interface ILength {
|
|
val length: Int
|
|
}
|
|
|
|
class Impl(override val length: Int) : ILength
|
|
|
|
fun <T> foo(a: (Int) -> T) = 0
|
|
fun <T : ILength> bar(a: (Int) -> T) {
|
|
a(42).length
|
|
}
|
|
|
|
fun test() {
|
|
<!INAPPLICABLE_CANDIDATE!>foo<!><String> { }
|
|
<!INAPPLICABLE_CANDIDATE!>bar<!><Impl> { }
|
|
}
|