[scripting] Make properties from destructing declarations available with reflection

This commit is contained in:
Ilya Muradyan
2021-10-05 16:40:59 +03:00
committed by teamcityserver
parent 1c16f2f8c9
commit 58831eacca
5 changed files with 65 additions and 1 deletions
@@ -212,6 +212,15 @@ protected constructor(
}.toList()
}
protected open fun collectDescriptorsFromDestructingDeclaration(
result: MutableSet<DeclarationDescriptor>,
declaration: KtDestructuringDeclaration,
nameFilter: (Name) -> Boolean,
location: LookupLocation,
) {
// MultiDeclarations are not supported on global level by default
}
protected fun computeDescriptorsFromDeclaredElements(
kindFilter: DescriptorKindFilter,
nameFilter: (Name) -> Boolean,
@@ -258,7 +267,7 @@ protected constructor(
}
}
is KtDestructuringDeclaration -> {
// MultiDeclarations are not supported on global level
collectDescriptorsFromDestructingDeclaration(result, declaration, nameFilter, location)
}
else -> throw IllegalArgumentException("Unsupported declaration kind: " + declaration)
}