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.
26 lines
780 B
Kotlin
Vendored
26 lines
780 B
Kotlin
Vendored
// TARGET_BACKEND: JVM
|
|
|
|
// WITH_REFLECT
|
|
|
|
open class C(val a: Any)
|
|
|
|
fun box(): String {
|
|
class L : C({}) {
|
|
}
|
|
val l = L()
|
|
|
|
val javaClass = l.a.javaClass
|
|
val enclosingMethod = javaClass.getEnclosingConstructor()!!.getName()
|
|
if (enclosingMethod != "LambdaInLocalClassSuperCallKt\$box\$L") return "ctor: $enclosingMethod"
|
|
|
|
val enclosingClass = javaClass.getEnclosingClass()!!.getName()
|
|
if (enclosingClass != "LambdaInLocalClassSuperCallKt\$box\$L") return "enclosing class: $enclosingClass"
|
|
|
|
if (enclosingMethod != enclosingClass) return "$enclosingClass != $enclosingMethod"
|
|
|
|
val declaringClass = javaClass.getDeclaringClass()
|
|
if (declaringClass != null) return "anonymous function has a declaring class: $declaringClass"
|
|
|
|
return "OK"
|
|
}
|