Files
kotlin-fork/compiler/testData/diagnostics/tests/resolve/invoke/kt51793Complex.kt
T
Denis.Zharkov 69a6339935 K2: Add test for obsolete KT-51793
^KT-51793 Fixed
2023-06-07 14:49:22 +00:00

30 lines
501 B
Kotlin
Vendored

// FIR_IDENTICAL
// ISSUE: KT-51793
interface Key1
interface Key2
interface A1 {
operator fun Key2.invoke(): String = ""
}
interface A2 {
operator fun Key1.invoke(): Int = 1
}
val A1.k: Key1 get() = object : Key1 {}
val A2.k: Key2 get() = object : Key2 {}
fun with1(a: A1.() -> Unit) {
a(object : A1 {})
}
fun with2(a: A2.() -> Unit) {
a(object : A2 {})
}
fun main() {
with1 {
with2 {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>k()<!>
}
}
}