From now all customization of session should perform via DSL which
declared in FirSessionFactory. Registration or mutation session
services from other places is prohibited
This is needed because we have different visibility rules for different
platform visibilities (e.g. protected and package private on JVM), so
we need ability to configure visibility checks for different platforms
There was one non-removable usage of those function in FirJavaElementFinder
and three non-trivial implementation
- `FirProvider.SymbolProvider`
- `KotlinDeserializedJvmSymbolsProvider`
- `FirBuiltinSymbolProvider`
First implementation was moved to `FirProvider` and other two was
deleted, because in FirJavaElementFinder we need lookup only in
classes from source code, so such methods in library providers are
useless
#KT-41048
Now, FirTypeScope returns only direct overridden and a base scope
where a client might look for deeper overridden
It's necessary to make the API fast and simple
when only direct overridden are needed
At the same time, while this API looks a bit complicated for most of the clients
there are simple extension helpers that obtain just the direct or all overridden
- Cache ModuleResolveState for module till the world changes
- Resolve every file under a lock
- All creation of raw fir files and resolve of them happens in FirFileBuilder
- Lazy resolve of fir elements happens in FirElementBuilder
Caching works like the following:
- FirModuleResolveState holds PsiToFirCache & DiagnosticsCollector & FileCacheForModuleProvider
- FileCacheForModuleProvider holds a mapping from ModuleInfo to ModuleFileCache
- ModuleFileCache caches
- KtFile -> FirFile mapping
- ClassId -> FirClassLikeDeclaration, CallableId -> FirCallableSymbol
which used in corresponding FirProvider
- mapping from declaration to it's file
which used in corresponding FirProvider
- locks for fir file resolving
- PsiToFirCache provides mapping from KtElement to FirElement
- DiagnosticsCollector collects diagnostics for file and caches them
This commit introduces several different things, in particular:
- check type arguments in expressions
- new TypeArgumentList node to deal with diagnostic source
- ConeDiagnostic was moved to fir:cones
- ConeIntermediateDiagnostic to use in inference (?) without reporting
- detailed diagnostics on error type
Before this commit, we had effective visibility as a part of FIR status,
so it was integrated into the full pipeline. In this commit,
we introduced "effective visibility as a service" which is now used
only by exposed visibility checker. This allows us to make the thing
universal for all FIR nodes, including nodes for Java / deserialized.