Index properties defined in primary constructor

#KT-15029 Fixed
This commit is contained in:
Dmitry Jemerov
2017-05-09 19:03:32 +02:00
parent ec53a6dbe7
commit 9c4f897d31
13 changed files with 51 additions and 28 deletions
@@ -247,3 +247,11 @@ object LightClassUtil {
override fun iterator(): Iterator<PsiMethod> = allMethods.iterator()
}
}
fun KtNamedDeclaration.getAccessorLightMethods(): LightClassUtil.PropertyAccessorsPsiMethods {
return when (this) {
is KtProperty -> LightClassUtil.getLightClassPropertyMethods(this)
is KtParameter -> LightClassUtil.getLightClassPropertyMethods(this)
else -> throw IllegalStateException("Unexpected property type: ${this}")
}
}