Files
kotlin-fork/compiler/testData/codegen/box/regressions/nestedIntersection.kt
T
Juan Chen 4f6fe1d0ca [FIR]: fix translation of top-level property accesses like array.indices
This commit addresses the following issues:

* accessors didn't take into account their property's receiver type,
which caused NoSuchMethod due to signature mismatch. Now the property's
receiver type is passed to Fir2Ir translation of accessors.

* property's parent was not class, e.g., kotlin.collections.indices.
Now the symbol table collects WrappedPropertyDescriptorWithContainerSource
besides WrappedFunctionDescriptorWithContainerSource, so that
facade classes for such properties can be generated before codegen.

* accessor's parent was not class. Now the containerSource of
the property descriptor is passed to accessor descriptor.
2020-02-25 12:13:42 +03:00

19 lines
420 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// WITH_RUNTIME
interface In<in E>
open class A : In<A>
open class B : In<B>
inline fun <reified T : Any> select(x: T, y: T) = T::class.java.simpleName
// This test checks mostly that no StackOverflow happens while mapping type argument of select-call (In<A & B>)
// See KT-10972
fun foo(): String = select(A(), B())
fun box(): String {
if (foo() != "In") return "fail"
return "OK"
}