a02cf76d6c
Before this commit, we assumed (erroneously) that a captured type cannot have an associated SAM-based function type. In this commit we changed this assumption, replacing a captured type with its lower type for this purpose #KT-63379 Fixed
18 lines
440 B
Kotlin
Vendored
18 lines
440 B
Kotlin
Vendored
// ISSUE: KT-63379 (modified example, see original in unitInContravariantPosition.kt)
|
|
|
|
class TestDummyClass<T> {
|
|
fun testFun(t: T) {}
|
|
}
|
|
|
|
fun more(t: TestDummyClass<out CustomRunnable>) {
|
|
t.testFun <!TYPE_MISMATCH!>{ Unit }<!>
|
|
t.testFun(<!TYPE_MISMATCH!>CustomRunnable { Unit }<!>)
|
|
t.testFun(<!TYPE_MISMATCH!>object : CustomRunnable<!> {
|
|
override fun run() {}
|
|
})
|
|
}
|
|
|
|
fun interface CustomRunnable {
|
|
fun run()
|
|
}
|