JVM_IR: unwrap fake overrides when computing property signatures

This commit is contained in:
pyos
2019-04-10 15:45:41 +02:00
committed by max-kammerer
parent 1b68b1d599
commit 8ae9e7a106
3 changed files with 4 additions and 3 deletions
@@ -56,9 +56,12 @@ internal class PropertyReferenceLowering(val context: JvmBackendContext) : Class
private val IrMemberAccessExpression.field: IrFieldSymbol?
get() = (this as? IrPropertyReference)?.field
private val IrSimpleFunction.signature: String
get() = context.state.typeMapper.mapSignatureSkipGeneric(collectRealOverrides().first().descriptor).toString()
private val IrMemberAccessExpression.signature: String
get() = localPropertyIndices[getter]?.let { "<v#$it>" }
?: getter?.owner?.let { context.state.typeMapper.mapSignatureSkipGeneric(it.descriptor).toString() }
?: (getter?.owner as? IrSimpleFunction)?.signature
// Plain Java fields do not have a getter, but can be referenced nonetheless. The signature should be
// the one that a getter would have, if it existed.
?: TODO("plain Java field signature")
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR, JS, NATIVE
// WITH_REFLECT
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE