KT-8575 Add tests and disable reflection for Java synthetic property references

This commit is contained in:
Pavel Mikhailovskii
2022-09-22 10:48:14 +02:00
committed by teamcity
parent 5116bbc440
commit f8fd23e373
12 changed files with 210 additions and 46 deletions
@@ -351,7 +351,12 @@ internal class PropertyReferenceLowering(val context: JvmBackendContext) : IrEle
call.putValueArgument(index++, computeSignatureString(expression))
if (useOptimizedSuperClass) {
val isPackage = (container is IrClass && container.isFileClass) || container is IrPackageFragment
call.putValueArgument(index, irInt(if (isPackage) 1 else 0))
val isJavaSynthetic = (expression.symbol.owner as? IrProperty)?.let {
it.backingField == null &&
(it.origin == IrDeclarationOrigin.SYNTHETIC_JAVA_PROPERTY_DELEGATE
|| it.origin == IrDeclarationOrigin.IR_EXTERNAL_JAVA_DECLARATION_STUB)
} ?: false
call.putValueArgument(index, irInt((if (isPackage) 1 else 0) or (if (isJavaSynthetic) 2 else 0)))
}
}