[FIR] Properly deserialize annotations on typealias and underlying type
This commit is contained in:
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
public final typealias A1 = R|kotlin/String|
|
@R|test/Ann|() @R|test/Ann|() public final typealias A1 = R|kotlin/String|
|
||||||
|
|
||||||
public final typealias A2 = R|kotlin/String|
|
@R|test/Ann|(value = String(OK)) @R|test/Ann|(value = String(OK)) public final typealias A2 = R|kotlin/String|
|
||||||
|
|
||||||
@R|kotlin/annotation/Target|(allowedTargets = <implicitArrayOf>(R|kotlin/annotation/AnnotationTarget.TYPEALIAS|())) public final annotation class Ann : R|kotlin/Annotation| {
|
@R|kotlin/annotation/Target|(allowedTargets = <implicitArrayOf>(R|kotlin/annotation/AnnotationTarget.TYPEALIAS|())) public final annotation class Ann : R|kotlin/Annotation| {
|
||||||
public final val value: R|kotlin/String|
|
public final val value: R|kotlin/String|
|
||||||
|
|||||||
+1
-1
@@ -5,5 +5,5 @@ public final class Foo<T> : R|kotlin/Any| {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public final typealias MyHandler<P> = R|(test/Foo<P>) -> kotlin/Unit|
|
public final typealias MyHandler<P> = R|test/Foo<P>.() -> kotlin/Unit|
|
||||||
|
|
||||||
|
|||||||
+5
@@ -58,6 +58,11 @@ abstract class AbstractAnnotationDeserializer(
|
|||||||
return annotations.map { deserializeAnnotation(it, nameResolver) }
|
return annotations.map { deserializeAnnotation(it, nameResolver) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun loadTypeAliasAnnotations(aliasProto: ProtoBuf.TypeAlias, nameResolver: NameResolver): List<FirAnnotationCall> {
|
||||||
|
if (!Flags.HAS_ANNOTATIONS.get(aliasProto.flags)) return emptyList()
|
||||||
|
return aliasProto.annotationList.map { deserializeAnnotation(it, nameResolver) }
|
||||||
|
}
|
||||||
|
|
||||||
open fun loadFunctionAnnotations(
|
open fun loadFunctionAnnotations(
|
||||||
containerSource: DeserializedContainerSource?,
|
containerSource: DeserializedContainerSource?,
|
||||||
functionProto: ProtoBuf.Function,
|
functionProto: ProtoBuf.Function,
|
||||||
|
|||||||
+4
-6
@@ -15,10 +15,8 @@ import org.jetbrains.kotlin.fir.expressions.builder.buildExpressionStub
|
|||||||
import org.jetbrains.kotlin.fir.symbols.CallableId
|
import org.jetbrains.kotlin.fir.symbols.CallableId
|
||||||
import org.jetbrains.kotlin.fir.symbols.StandardClassIds
|
import org.jetbrains.kotlin.fir.symbols.StandardClassIds
|
||||||
import org.jetbrains.kotlin.fir.symbols.impl.*
|
import org.jetbrains.kotlin.fir.symbols.impl.*
|
||||||
import org.jetbrains.kotlin.fir.types.ConeAttributes
|
import org.jetbrains.kotlin.fir.types.*
|
||||||
import org.jetbrains.kotlin.fir.types.FirTypeRef
|
|
||||||
import org.jetbrains.kotlin.fir.types.builder.buildResolvedTypeRef
|
import org.jetbrains.kotlin.fir.types.builder.buildResolvedTypeRef
|
||||||
import org.jetbrains.kotlin.fir.types.computeTypeAttributes
|
|
||||||
import org.jetbrains.kotlin.fir.types.impl.ConeClassLikeTypeImpl
|
import org.jetbrains.kotlin.fir.types.impl.ConeClassLikeTypeImpl
|
||||||
import org.jetbrains.kotlin.fir.types.impl.ConeTypeParameterTypeImpl
|
import org.jetbrains.kotlin.fir.types.impl.ConeTypeParameterTypeImpl
|
||||||
import org.jetbrains.kotlin.fir.types.impl.FirImplicitUnitTypeRef
|
import org.jetbrains.kotlin.fir.types.impl.FirImplicitUnitTypeRef
|
||||||
@@ -168,10 +166,10 @@ class FirMemberDeserializer(private val c: FirDeserializationContext) {
|
|||||||
isExpect = Flags.IS_EXPECT_CLASS.get(flags)
|
isExpect = Flags.IS_EXPECT_CLASS.get(flags)
|
||||||
isActual = false
|
isActual = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
annotations += c.annotationDeserializer.loadTypeAliasAnnotations(proto, local.nameResolver)
|
||||||
symbol = FirTypeAliasSymbol(classId)
|
symbol = FirTypeAliasSymbol(classId)
|
||||||
expandedTypeRef = buildResolvedTypeRef {
|
expandedTypeRef = proto.underlyingType(c.typeTable).toTypeRef(local)
|
||||||
type = local.typeDeserializer.type(proto.underlyingType(c.typeTable), ConeAttributes.Empty)
|
|
||||||
}
|
|
||||||
resolvePhase = FirResolvePhase.ANALYZED_DEPENDENCIES
|
resolvePhase = FirResolvePhase.ANALYZED_DEPENDENCIES
|
||||||
typeParameters += local.typeDeserializer.ownTypeParameters.map { it.fir }
|
typeParameters += local.typeDeserializer.ownTypeParameters.map { it.fir }
|
||||||
}.apply {
|
}.apply {
|
||||||
|
|||||||
Reference in New Issue
Block a user