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.
23 lines
631 B
Kotlin
Vendored
23 lines
631 B
Kotlin
Vendored
// TARGET_BACKEND: JVM
|
|
|
|
// WITH_REFLECT
|
|
|
|
fun box(): String {
|
|
|
|
val classInLambda = {
|
|
class Z {}
|
|
Z()
|
|
}()
|
|
|
|
val enclosingMethod = classInLambda.javaClass.getEnclosingMethod()
|
|
if (enclosingMethod?.getName() != "invoke") return "method: $enclosingMethod"
|
|
|
|
val enclosingClass = classInLambda.javaClass.getEnclosingClass()!!.getName()
|
|
if (enclosingClass != "ClassInLambdaKt\$box\$classInLambda\$1") return "enclosing class: $enclosingClass"
|
|
|
|
val declaringClass = classInLambda.javaClass.getDeclaringClass()
|
|
if (declaringClass != null) return "class has a declaring class"
|
|
|
|
return "OK"
|
|
}
|