mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-16 00:21:32 +00:00
Use lower approximation bound to obtain acceptable types for lambda parameters those types depend on captured type #KT-12238 Fixed #KT-10627 Fixed
23 lines
381 B
Kotlin
Vendored
23 lines
381 B
Kotlin
Vendored
// !CHECK_TYPE
|
|
// FILE: A.java
|
|
import java.util.function.Consumer;
|
|
|
|
public class A<T> {
|
|
void test(Consumer<? super T> consumer) {}
|
|
}
|
|
|
|
// FILE: 1.kt
|
|
import java.util.function.Consumer
|
|
|
|
fun test(a: A<out Number>) {
|
|
a.test (Consumer {
|
|
it checkType { _<Number>() }
|
|
it.toInt()
|
|
})
|
|
|
|
a.test {
|
|
it checkType { _<Number>() }
|
|
it.toInt()
|
|
}
|
|
}
|