KotlinClsStubBuilder: fix reading header for multifile facades

This commit is contained in:
Pavel V. Talanov
2015-09-09 22:00:26 +03:00
parent 6239620f98
commit 40773ad04a
@@ -60,6 +60,11 @@ public open class KotlinClsStubBuilder : ClsStubBuilder() {
}
val components = createStubBuilderComponents(file, packageFqName)
if (header.isCompatibleMultifileClassKind()) {
val partHeaders = readMultifileClassPartHeaders(file, kotlinBinaryClass)
return createMultifileClassStub(partHeaders, classId.asSingleFqName(), components)
}
val annotationData = header.annotationData
if (annotationData == null) {
LOG.error("Corrupted kotlin header for file ${file.getName()}")
@@ -82,10 +87,6 @@ public open class KotlinClsStubBuilder : ClsStubBuilder() {
val context = components.createContext(packageData.getNameResolver(), packageFqName)
createFileFacadeStub(packageData.getPackageProto(), classId.asSingleFqName(), context)
}
header.isCompatibleMultifileClassKind() -> {
val partHeaders = readMultifileClassPartHeaders(file, kotlinBinaryClass)
createMultifileClassStub(partHeaders, classId.asSingleFqName(), components)
}
else -> throw IllegalStateException("Should have processed " + file.getPath() + " with header $header")
}
}