https://kotlinlang.org logo
#compiler
Title
# compiler
a

apatrida

09/26/2023, 2:31 PM
Hi, I'm running into the error "Unexpected caches clearing" from
FirCachingCompositeSymbolProvider
being called from
afterPhase
to
createCopyWithCleanCaches()
This is from
arrow-reflection
being upgraded to work with 1.9.20-Beta2 compiler. The code in arrow is creating a new function when this error happens. The assert from
FirCompilerRequiredAnnotationsResolveProcessor
method `afterPhase`:
Copy code
require(expectedCachesToBeCleanedOnce) { "Unexpected caches clearing" }
Is protecting against what? that caches are not cleared more than once? What is the harm of this being called again?
d

dmitriy.novozhilov

10/04/2023, 7:56 AM
Symbol providers should always return the same results for the same inputs But there is one quirk related to annotations resolution, which are required for compiler plugins, so resolution of some names before and after this phase may differ for the same name And clean caches is called to invalidate potentially incorrect caches after this phase This function is not intended to be called outside few specific places inside the compier
a

apatrida

10/06/2023, 10:44 PM
thanks, the issue is we are compiling fragments during compilation to copy the IR over and in the nested compile hit issues. Probably not a "designed for" use case yet.