Build name correctly in ShadowedDeclarationsFilter
So #KT-16383 Fixed Also should fix EA-104812, EA-99338, EA-107064
This commit is contained in:
@@ -118,14 +118,19 @@ class ShadowedDeclarationsFilter(
|
|||||||
): Collection<TDescriptor> {
|
): Collection<TDescriptor> {
|
||||||
if (descriptors.size == 1) return descriptors
|
if (descriptors.size == 1) return descriptors
|
||||||
|
|
||||||
val first = descriptors.first()
|
val first = descriptors.firstOrNull {
|
||||||
|
it is ClassDescriptor || it is ConstructorDescriptor || it is CallableDescriptor && !it.name.isSpecial
|
||||||
|
} ?: return descriptors
|
||||||
|
|
||||||
if (first is ClassDescriptor) { // for classes with the same FQ-name we simply take the first one
|
if (first is ClassDescriptor) { // for classes with the same FQ-name we simply take the first one
|
||||||
return listOf(first)
|
return listOf(first)
|
||||||
}
|
}
|
||||||
|
|
||||||
val isFunction = first is FunctionDescriptor
|
val isFunction = first is FunctionDescriptor
|
||||||
val name = first.name
|
val name = when (first) {
|
||||||
|
is ConstructorDescriptor -> first.constructedClass.name
|
||||||
|
else -> first.name
|
||||||
|
}
|
||||||
val parameters = (first as CallableDescriptor).valueParameters
|
val parameters = (first as CallableDescriptor).valueParameters
|
||||||
|
|
||||||
val dummyArgumentExpressions = dummyExpressionFactory.createDummyExpressions(parameters.size)
|
val dummyArgumentExpressions = dummyExpressionFactory.createDummyExpressions(parameters.size)
|
||||||
|
|||||||
Reference in New Issue
Block a user