[K/N][IR] Handle some corner cases for enums when building caches

Helps workaround https://youtrack.jetbrains.com/issue/KT-50977
This commit is contained in:
Igor Chevdar
2022-01-31 13:33:26 +05:00
parent 0382610120
commit 97a28df43d
@@ -211,9 +211,10 @@ internal fun ProtoClass.findClass(irClass: IrClass, fileReader: IrLibraryFile, s
for (i in 0 until this.declarationCount) {
val child = this.getDeclaration(i)
val childClass = when (child.declaratorCase) {
ProtoDeclaration.DeclaratorCase.IR_CLASS -> child.irClass
ProtoDeclaration.DeclaratorCase.IR_ENUM_ENTRY -> child.irEnumEntry.correspondingClass
val childClass = when {
child.declaratorCase == ProtoDeclaration.DeclaratorCase.IR_CLASS -> child.irClass
child.declaratorCase == ProtoDeclaration.DeclaratorCase.IR_ENUM_ENTRY
&& child.irEnumEntry.hasCorrespondingClass() -> child.irEnumEntry.correspondingClass
else -> continue
}