Create InvalidLightClassDataHolder for expect classes

This fixes an exception from duplicateJvmSignature reporter
Fixes "QuickFixTestGenerated$Override.testDontOfferToImplementMembersForExpectedClass" on teamcity
This commit is contained in:
Pavel V. Talanov
2018-03-02 17:46:31 +01:00
parent 89c82a85d0
commit 6c4537accc
2 changed files with 9 additions and 5 deletions
@@ -341,7 +341,7 @@ abstract class KtLightClassForSourceDeclaration(protected val classOrObject: KtC
}
fun createNoCache(classOrObject: KtClassOrObject): KtLightClassForSourceDeclaration? {
if (classOrObject.parentsWithSelf.filterIsInstance<KtClassOrObject>().any { it.hasExpectModifier() }) {
if (classOrObject.shouldNotBeVisibleAsLightClass()) {
return null
}
@@ -515,3 +515,6 @@ fun KtClassOrObject.defaultJavaAncestorQualifiedName(): String? {
else -> CommonClassNames.JAVA_LANG_OBJECT
}
}
fun KtClassOrObject.shouldNotBeVisibleAsLightClass() =
parentsWithSelf.filterIsInstance<KtClassOrObject>().any { it.hasExpectModifier() }