[FIR] DeprecationsProvider: make evaluation of deprecations on demand

This commit is contained in:
Arseniy Terekhov
2022-08-10 18:06:59 +03:00
committed by teamcity
parent 98ebad2d75
commit 25fc948d95
89 changed files with 517 additions and 326 deletions
@@ -226,7 +226,7 @@ fun deserializeClassToSymbol(
it.sourceElement = containerSource
it.replaceDeprecation(it.getDeprecationInfos(session.languageVersionSettings.apiVersion))
it.replaceDeprecationsProvider(it.getDeprecationsProvider())
classProto.getExtensionOrNull(JvmProtoBuf.classModuleName)?.let { idx ->
it.moduleName = nameResolver.getString(idx)
@@ -421,7 +421,7 @@ class FirMemberDeserializer(private val c: FirDeserializationContext) {
}
this.containerSource = c.containerSource
this.initializer = c.constDeserializer.loadConstant(proto, symbol.callableId, c.nameResolver)
deprecation = annotations.getDeprecationInfosFromAnnotations(c.session.languageVersionSettings.apiVersion, false)
deprecationsProvider = annotations.getDeprecationsProviderFromAnnotations(false)
proto.contextReceiverTypes(c.typeTable).mapTo(contextReceivers, ::loadContextReceiver)
}.apply {
@@ -499,7 +499,7 @@ class FirMemberDeserializer(private val c: FirDeserializationContext) {
)
annotations +=
c.annotationDeserializer.loadFunctionAnnotations(c.containerSource, proto, local.nameResolver, local.typeTable)
deprecation = annotations.getDeprecationInfosFromAnnotations(c.session.languageVersionSettings.apiVersion, false)
deprecationsProvider = annotations.getDeprecationsProviderFromAnnotations(false)
this.containerSource = c.containerSource
proto.contextReceiverTypes(c.typeTable).mapTo(contextReceivers, ::loadContextReceiver)
@@ -578,7 +578,7 @@ class FirMemberDeserializer(private val c: FirDeserializationContext) {
annotations +=
c.annotationDeserializer.loadConstructorAnnotations(c.containerSource, proto, local.nameResolver, local.typeTable)
containerSource = c.containerSource
deprecation = annotations.getDeprecationInfosFromAnnotations(c.session.languageVersionSettings.apiVersion, false)
deprecationsProvider = annotations.getDeprecationsProviderFromAnnotations(false)
contextReceivers.addAll(createContextReceiversForClass(classProto))
}.build().apply {