Files
kotlin-fork/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt31670_compat.kt
T
Denis.Zharkov 2ecba6ac39 Remove WITH_NEW_INFERENCE directive from all tests
This directive anyway does not make test run twice with OI, and with NI
It only once run the test with specific settings (// LANGUAGE)
and ignores irrelevant (OI or NI tags)
2021-05-25 13:28:26 +03:00

15 lines
307 B
Kotlin
Vendored

// !CONSTRAINT_SYSTEM_FOR_OVERLOAD_RESOLUTION: CONSTRAINT_SYSTEM_FOR_OLD_INFERENCE
open class A<T>(val value: T)
class B<T>(value: T) : A<T>(value)
fun <T> A<T>.foo(block: (T?) -> Unit) {
block(value)
}
fun <T> B<T>.foo(block: (T) -> Unit) {
block(value)
}
fun main() {
B("string").foo { }
}