[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.
This commit is contained in:
Yan Zhulanow
2023-06-01 17:25:05 +09:00
committed by Space Team
parent f5c9c1d78e
commit 2600dc7f1e
@@ -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 {