Use possible incompatible metadata as a fallback for incremental analysis

If LeverVersion is set to greater than 1 of the current compiler version, metadata became null here org.jetbrains.kotlin.load.kotlin.header.ReadKotlinClassHeaderAnnotationVisitor.createHeader, which leads to NPE during incremental analysis. Using the same incompatible data as fallback prevent it

#KTIJ-20954 Fixed

Merge-request: KT-MR-5680
Merged-by: Aleksei Cherepanov <aleksei.cherepanov@jetbrains.com>
This commit is contained in:
Aleksei.Cherepanov
2022-02-04 09:42:05 +00:00
committed by Space
parent 6601b8b62c
commit a80d01265a
2 changed files with 22 additions and 1 deletions
@@ -652,7 +652,7 @@ class KotlinClassInfo constructor(
return KotlinClassInfo(
classId,
classHeader.kind,
classHeader.data ?: emptyArray(),
classHeader.data ?: classHeader.incompatibleData ?: emptyArray(),
classHeader.strings ?: emptyArray(),
classHeader.multifileClassName,
constantsMap = constantsAndInlineFunctions.first,