[FIR] Get rid of FirExtension.key
In reality plugin key was used only in two ways: - found corresponding generator for member scope of generated class - pass it to declaration origin so it can be read in backend IR plugin Because of first usage plugin key was required to be an object, which reduces functionality of second usage, because there was no way to pass any additional info via key to IR (in future this usecase will be covered with IR declaration attributes, but right now we don't have them) So now generator which created some class is now saved in its attributes and plugins can use any keys they want. And since there is no other usages of `FirExtension.key` it removed from FirExtension API at all
This commit is contained in:
committed by
TeamCityServer
parent
e7af50fe2b
commit
c46e9943cc
-4
@@ -10,13 +10,9 @@ import org.jetbrains.kotlin.fir.analysis.checkers.declaration.*
|
||||
import org.jetbrains.kotlin.fir.analysis.checkers.expression.ExpressionCheckers
|
||||
import org.jetbrains.kotlin.fir.analysis.checkers.expression.FirAnnotationCallChecker
|
||||
import org.jetbrains.kotlin.fir.analysis.extensions.FirAdditionalCheckersExtension
|
||||
import org.jetbrains.kotlin.fir.declarations.FirPluginKey
|
||||
import org.jetbrains.kotlin.parcelize.fir.diagnostics.*
|
||||
|
||||
class FirParcelizeCheckersExtension(session: FirSession) : FirAdditionalCheckersExtension(session) {
|
||||
override val key: FirPluginKey
|
||||
get() = FirParcelizePluginKey
|
||||
|
||||
override val expressionCheckers: ExpressionCheckers = object : ExpressionCheckers() {
|
||||
override val annotationCallCheckers: Set<FirAnnotationCallChecker>
|
||||
get() = setOf(FirParcelizeAnnotationChecker)
|
||||
|
||||
+1
-1
@@ -176,7 +176,7 @@ class FirParcelizeDeclarationGenerator(session: FirSession) : FirDeclarationGene
|
||||
}
|
||||
}
|
||||
|
||||
override val key: FirPluginKey
|
||||
private val key: FirPluginKey
|
||||
get() = FirParcelizePluginKey
|
||||
|
||||
override fun FirDeclarationPredicateRegistrar.registerPredicates() {
|
||||
|
||||
Reference in New Issue
Block a user