[LL FIR] resolve propagated type annotations correctly

This commit is Low Level FIR part of changes around propagated
annotations (aka foreign annotations).
It includes such changes as:
* implicit type phase postpones foreign annotations resolution
* annotation arguments are requests resolution for postponed
annotations from implicit type phase as a pre-resolve step
* body resolve phase just calls lazy resolution for foreign annotations
on demand
* isResolved check for type annotations to be sure that all annotations
are resolved after annotation arguments phase

^KT-63042 Fixed
^KT-63681 Fixed
This commit is contained in:
Dmitrii Gridin
2023-11-24 17:17:24 +01:00
committed by Space Team
parent cf11e26755
commit 97956b4374
167 changed files with 1881 additions and 1547 deletions
@@ -19,6 +19,7 @@ import org.jetbrains.kotlin.fir.resolve.transformers.ScopeClassDeclaration
import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol
import org.jetbrains.kotlin.fir.types.*
import org.jetbrains.kotlin.fir.visitors.FirTransformer
import org.jetbrains.kotlin.fir.visitors.transformSingle
abstract class FirAbstractBodyResolveTransformerDispatcher(
session: FirSession,
@@ -106,7 +107,12 @@ abstract class FirAbstractBodyResolveTransformerDispatcher(
override fun transformImplicitTypeRef(implicitTypeRef: FirImplicitTypeRef, data: ResolutionMode): FirTypeRef {
if (data !is ResolutionMode.WithExpectedType)
return implicitTypeRef
return data.expectedTypeRef
/**
* We should transform a provided type to process such references in [transformAnnotationCall] by [transformForeignAnnotationCall]
* because usually we do not run such transformations on replaced types explicitly
*/
return data.expectedTypeRef.transformSingle(this, data)
}
// ------------------------------------- Expressions -------------------------------------