Files
kotlin-fork/compiler/testData/diagnostics/tests/funInterface/unitInContravariantPosition.kt
T
Mikhail Glukhikh a02cf76d6c K2: build SAM-based function type for a given captured type properly
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
2023-12-21 10:19:23 +00:00

19 lines
329 B
Kotlin
Vendored

// FIR_IDENTICAL
// ISSUE: KT-63379
class TestDummyClass<T> {
fun testFun(t: T) {}
}
fun more(t: TestDummyClass<in CustomRunnable>) {
t.testFun { Unit }
t.testFun(CustomRunnable { Unit })
t.testFun(object : CustomRunnable {
override fun run() {}
})
}
fun interface CustomRunnable {
fun run()
}