Files
kotlin-fork/compiler/testData/diagnostics/tests/inference/complexInferenceOnParentizedExpression.kt
T
Dmitriy Novozhilov 4b5eac7816 [Test] Add regression tests for issues which are fixed in K2
Related issues:
KT-10879, KT-18055, KT-20617, KT-23873
KT-25668, KT-31191, KT-33108, KT-41013
KT-51827, KT-53886, KT-56624, KT-58447
KT-58458, KT-58751, KT-58814, KT-60597
KT-62806, KT-63258, KT-63444, KT-65101
KT-65408, KT-65844, KT-66186

^KT-65926 Fixed
2024-03-07 12:49:47 +00:00

38 lines
793 B
Kotlin
Vendored

// ISSUE: KT-65101
// WITH_STDLIB
interface Context<C: Context<C>>
interface InterfaceA<C: Context<C>>
class ABuilder<C: Context<C>, A: InterfaceA<C>, B: InterfaceA<C>>
operator fun <C, A, B> ABuilder<C, A, B>.invoke(block: B.() -> Unit): Unit
where C: Context<C>,
A: InterfaceA<C>,
B: InterfaceA<C>
= null!!
object ContextImpl : Context<ContextImpl>
object RootA : InterfaceA<ContextImpl>
class AImpl<P: Context<P>> : InterfaceA<P> {
fun foo(): Int = null!!
}
val <C: Context<C>, A: InterfaceA<C>> A.impl get() = ABuilder<C, A, AImpl<C>>()
fun test_1() {
RootA.apply {
(impl) {
foo()
}
}
}
fun test_2() {
RootA.apply {
impl {
<!UNRESOLVED_REFERENCE!>foo<!>()
}
}
}