K2: expand type aliases in annotation position #KT-55615 Fixed
This commit is contained in:
committed by
Space Team
parent
3cf811012a
commit
0d50f71fb8
@@ -199,7 +199,7 @@ abstract class FirJavaFacade(
|
||||
}
|
||||
}
|
||||
firJavaClass.replaceSuperTypeRefs(enhancedSuperTypes)
|
||||
firJavaClass.replaceDeprecationsProvider(firJavaClass.getDeprecationsProvider(session.firCachesFactory))
|
||||
firJavaClass.replaceDeprecationsProvider(firJavaClass.getDeprecationsProvider(session))
|
||||
return firJavaClass
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,9 @@ class JvmSupertypeUpdater(private val session: FirSession) : PlatformSupertypeUp
|
||||
private val jvmRecordUpdater = DelegatedConstructorCallTransformer(session)
|
||||
|
||||
override fun updateSupertypesIfNeeded(firClass: FirClass, scopeSession: ScopeSession) {
|
||||
if (!(firClass is FirRegularClass && firClass.isData && firClass.hasAnnotationSafe(StandardClassIds.Annotations.JvmRecord))) return
|
||||
if (firClass !is FirRegularClass || !firClass.isData ||
|
||||
!firClass.hasAnnotationSafe(StandardClassIds.Annotations.JvmRecord, session)
|
||||
) return
|
||||
var anyFound = false
|
||||
var hasExplicitSuperClass = false
|
||||
val newSuperTypeRefs = firClass.superTypeRefs.mapTo(mutableListOf()) {
|
||||
|
||||
@@ -11,7 +11,6 @@ import org.jetbrains.kotlin.descriptors.Visibility
|
||||
import org.jetbrains.kotlin.fir.FirImplementationDetail
|
||||
import org.jetbrains.kotlin.fir.FirModuleData
|
||||
import org.jetbrains.kotlin.fir.builder.FirBuilderDsl
|
||||
import org.jetbrains.kotlin.fir.caches.firCachesFactory
|
||||
import org.jetbrains.kotlin.fir.declarations.*
|
||||
import org.jetbrains.kotlin.fir.declarations.builder.FirFieldBuilder
|
||||
import org.jetbrains.kotlin.fir.expressions.FirAnnotation
|
||||
@@ -65,7 +64,7 @@ class FirJavaField @FirImplementationDetail constructor(
|
||||
get() = lazyInitializer.value
|
||||
|
||||
override val deprecationsProvider: DeprecationsProvider by lazy {
|
||||
annotations.getDeprecationsProviderFromAnnotations(fromJava = true, moduleData.session.firCachesFactory)
|
||||
annotations.getDeprecationsProviderFromAnnotations(moduleData.session, fromJava = true)
|
||||
}
|
||||
|
||||
override val contextReceivers: List<FirContextReceiver>
|
||||
|
||||
+1
-2
@@ -9,7 +9,6 @@ import org.jetbrains.kotlin.descriptors.SourceElement
|
||||
import org.jetbrains.kotlin.fir.FirSession
|
||||
import org.jetbrains.kotlin.fir.ThreadSafeMutableState
|
||||
import org.jetbrains.kotlin.fir.builder.toMutableOrEmpty
|
||||
import org.jetbrains.kotlin.fir.caches.firCachesFactory
|
||||
import org.jetbrains.kotlin.fir.declarations.FirDeclarationOrigin
|
||||
import org.jetbrains.kotlin.fir.declarations.getDeprecationsProvider
|
||||
import org.jetbrains.kotlin.fir.deserialization.*
|
||||
@@ -158,7 +157,7 @@ class JvmClassFileBasedSymbolProvider(
|
||||
kotlinClass.byteContent,
|
||||
)
|
||||
symbol.fir.replaceAnnotations(annotations.toMutableOrEmpty())
|
||||
symbol.fir.replaceDeprecationsProvider(symbol.fir.getDeprecationsProvider(session.firCachesFactory))
|
||||
symbol.fir.replaceDeprecationsProvider(symbol.fir.getDeprecationsProvider(session))
|
||||
}
|
||||
|
||||
private fun String?.toPath(): Path? {
|
||||
|
||||
+2
-2
@@ -169,7 +169,7 @@ class FirSignatureEnhancement(
|
||||
delegateGetter = enhancedGetterSymbol.fir as FirSimpleFunction
|
||||
delegateSetter = enhancedSetterSymbol?.fir as FirSimpleFunction?
|
||||
status = firElement.status
|
||||
deprecationsProvider = getDeprecationsProviderFromAccessors(delegateGetter, delegateSetter, session.firCachesFactory)
|
||||
deprecationsProvider = getDeprecationsProviderFromAccessors(session, delegateGetter, delegateSetter)
|
||||
}.symbol
|
||||
}
|
||||
else -> {
|
||||
@@ -332,7 +332,7 @@ class FirSignatureEnhancement(
|
||||
}
|
||||
this.valueParameters += newValueParameters
|
||||
annotations += firMethod.annotations
|
||||
deprecationsProvider = annotations.getDeprecationsProviderFromAnnotations(fromJava = true, session.firCachesFactory)
|
||||
deprecationsProvider = annotations.getDeprecationsProviderFromAnnotations(session, fromJava = true)
|
||||
}.build().apply {
|
||||
if (isJavaRecordComponent) {
|
||||
this.isJavaRecordComponent = true
|
||||
|
||||
+1
-2
@@ -8,7 +8,6 @@ package org.jetbrains.kotlin.fir.java.scopes
|
||||
import org.jetbrains.kotlin.builtins.StandardNames
|
||||
import org.jetbrains.kotlin.descriptors.Modality
|
||||
import org.jetbrains.kotlin.fir.*
|
||||
import org.jetbrains.kotlin.fir.caches.firCachesFactory
|
||||
import org.jetbrains.kotlin.fir.declarations.*
|
||||
import org.jetbrains.kotlin.fir.declarations.builder.buildSimpleFunctionCopy
|
||||
import org.jetbrains.kotlin.fir.declarations.impl.FirDeclarationStatusImpl
|
||||
@@ -89,7 +88,7 @@ class JavaClassUseSiteMemberScope(
|
||||
chooseModalityForAccessor(property, delegateGetter)
|
||||
}
|
||||
)
|
||||
deprecationsProvider = getDeprecationsProviderFromAccessors(delegateGetter, delegateSetter, session.firCachesFactory)
|
||||
deprecationsProvider = getDeprecationsProviderFromAccessors(session, delegateGetter, delegateSetter)
|
||||
}.symbol
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user