From 2600dc7f1ea1f416f9be8482b68b1120194f6794 Mon Sep 17 00:00:00 2001 From: Yan Zhulanow Date: Thu, 1 Jun 2023 17:25:05 +0900 Subject: [PATCH] [fir2ir] Allow non-cached source parents for non-cached declarations In the IDE, there might come declarations from other files/modules that we link against, but not pass to the backend. As only declarations from the compiled files end up being in the cache, the consistency check should be relaxed. --- .../jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt index 6d65f16c71a..97106380d43 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt @@ -1693,7 +1693,7 @@ class Fir2IrDeclarationStorage( val declarationOrigin = computeDeclarationOrigin(firSymbol, parentOrigin) when (val parent = irParent) { is Fir2IrLazyClass -> { - assert(parentOrigin != IrDeclarationOrigin.DEFINED) { + assert(parentOrigin != IrDeclarationOrigin.DEFINED || configuration.allowNonCachedDeclarations) { "Should not have reference to public API uncached property from source code" } signature?.let {