diff --git a/python/src/com/jetbrains/reflection/ReflectionUtils.kt b/python/src/com/jetbrains/reflection/ReflectionUtils.kt index 4ef38fef1247..2500de401c24 100644 --- a/python/src/com/jetbrains/reflection/ReflectionUtils.kt +++ b/python/src/com/jetbrains/reflection/ReflectionUtils.kt @@ -118,11 +118,11 @@ fun getProperties(instance: Any, annotationToFilterByClass: Class<*>? = null, us val klass = instance.javaClass.kotlin val allKotlinProperties = LinkedHashSet(klass.memberProperties.filterIsInstance(KProperty::class.java)) - var delegatedProperties = listOf() // See DelegationProperty doc + val delegatedProperties = ArrayList() // See DelegationProperty doc allKotlinProperties.filter { it.isAnnotated(DelegationProperty::class) }.forEach { val delegatedInstance = it.getter.call(instance) if (delegatedInstance != null) { - delegatedProperties = getProperties(delegatedInstance, annotationToFilterBy?.java, false).properties + delegatedProperties.addAll(getProperties(delegatedInstance, annotationToFilterBy?.java, false).properties) allKotlinProperties.remove(it) } }