Light classes: getOwnInnerClasses() filters out inner classes with null names

#KT-13927 Fixed
This commit is contained in:
Pavel V. Talanov
2016-09-26 19:24:00 +03:00
parent 827b56e277
commit b275dacad8
4 changed files with 22 additions and 1 deletions
@@ -317,7 +317,12 @@ abstract class KtLightClassForSourceDeclaration(protected val classOrObject: KtC
override fun getOwnInnerClasses(): List<PsiClass> {
val result = ArrayList<PsiClass>()
classOrObject.declarations.filterIsInstance<KtClassOrObject>().mapNotNullTo(result) { create(it) }
classOrObject.declarations.filterIsInstance<KtClassOrObject>()
// workaround for ClassInnerStuffCache not supporting classes with null names, see KT-13927
// inner classes with null names can't be searched for and can't be used from java anyway
// we can't prohibit creating light classes with null names either since they can contain members
.filter { it.name != null }
.mapNotNullTo(result) { create(it) }
if (classOrObject.hasInterfaceDefaultImpls) {
result.add(KtLightClassForInterfaceDefaultImpls(classOrObject))