JVM: add $delegate method support to kotlinx-metadata

and kotlinp as well -- it is now possible to see the effect of the
previous commit.
This commit is contained in:
pyos
2021-06-30 19:35:20 +02:00
committed by Alexander Udalov
parent 5d0102a966
commit 1e7295c64e
4 changed files with 54 additions and 26 deletions
@@ -103,6 +103,7 @@ private fun visitProperty(
var jvmGetterSignature: JvmMemberSignature? = null
var jvmSetterSignature: JvmMemberSignature? = null
var jvmSyntheticMethodForAnnotationsSignature: JvmMemberSignature? = null
var jvmSyntheticMethodForDelegateSignature: JvmMemberSignature? = null
var isMovedFromInterfaceCompanion: Boolean = false
override fun visitReceiverParameterType(flags: Flags): KmTypeVisitor? =
@@ -138,6 +139,10 @@ private fun visitProperty(
override fun visitSyntheticMethodForAnnotations(signature: JvmMethodSignature?) {
jvmSyntheticMethodForAnnotationsSignature = signature
}
override fun visitSyntheticMethodForDelegate(signature: JvmMethodSignature?) {
jvmSyntheticMethodForDelegateSignature = signature
}
}
}
@@ -158,6 +163,9 @@ private fun visitProperty(
if (jvmSyntheticMethodForAnnotationsSignature != null) {
sb.appendLine(" // synthetic method for annotations: $jvmSyntheticMethodForAnnotationsSignature")
}
if (jvmSyntheticMethodForDelegateSignature != null) {
sb.appendLine(" // synthetic method for delegate: $jvmSyntheticMethodForDelegateSignature")
}
if (isMovedFromInterfaceCompanion) {
sb.appendLine(" // is moved from interface companion")
}