4f6fe1d0ca
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.
22 lines
553 B
Kotlin
Vendored
22 lines
553 B
Kotlin
Vendored
// TARGET_BACKEND: JVM
|
|
|
|
// WITH_RUNTIME
|
|
|
|
import kotlin.test.assertEquals
|
|
|
|
inline fun <reified T : Any> foo(x: Class<T> = T::class.java): String = x.getName()
|
|
|
|
inline fun <reified R : Any> bar(x: R): String = foo<R>()
|
|
|
|
fun box(): String {
|
|
assertEquals("java.lang.String", foo<String>())
|
|
assertEquals("java.lang.Integer", foo<Int>())
|
|
assertEquals("java.lang.Object", foo<Any>())
|
|
|
|
assertEquals("java.lang.String", bar("abc"))
|
|
assertEquals("java.lang.Integer", bar(1))
|
|
assertEquals("java.lang.Object", bar(Any()))
|
|
|
|
return "OK"
|
|
}
|