Fix stub mismatch for top level declaration with JvmPackageName (KT-21831)

ClassId stores jvm name and it differs from kotlin name in that case.

 #KT-21831 Fixed
This commit is contained in:
Nikolay Krasko
2018-03-13 15:36:47 +03:00
parent c1f43558b9
commit bc7ccbc39b
6 changed files with 54 additions and 5 deletions
@@ -56,7 +56,8 @@ open class KotlinClsStubBuilder : ClsStubBuilder() {
val kotlinClass = IDEKotlinBinaryClassCache.getKotlinBinaryClass(file, fileContent) ?: error("Can't find binary class for Kotlin file: $file")
val header = kotlinClass.classHeader
val classId = kotlinClass.classId
val packageFqName = classId.packageFqName
val packageFqName = header.packageName?.let { FqName(it) } ?: classId.packageFqName
if (!header.metadataVersion.isCompatible()) {
return createIncompatibleAbiVersionFileStub()
}