FIR deserializer: add proper container class id to nested class members
This commit is contained in:
committed by
Mikhail Glukhikh
parent
daf9f927d4
commit
ca350e64c2
+8
-4
@@ -44,10 +44,14 @@ fun deserializeClassToSymbol(
|
|||||||
).apply {
|
).apply {
|
||||||
|
|
||||||
val context =
|
val context =
|
||||||
parentContext?.childContext(classProto.typeParameterList, nameResolver, TypeTable(classProto.typeTable))
|
parentContext?.childContext(
|
||||||
?: FirDeserializationContext.createForClass(
|
classProto.typeParameterList,
|
||||||
classId, classProto, nameResolver, session, FirBuiltinAnnotationDeserializer(session, nameResolver)
|
nameResolver,
|
||||||
)
|
TypeTable(classProto.typeTable),
|
||||||
|
classId.relativeClassName
|
||||||
|
) ?: FirDeserializationContext.createForClass(
|
||||||
|
classId, classProto, nameResolver, session, FirBuiltinAnnotationDeserializer(session, nameResolver)
|
||||||
|
)
|
||||||
typeParameters += context.typeDeserializer.ownTypeParameters.map { it.firUnsafe() }
|
typeParameters += context.typeDeserializer.ownTypeParameters.map { it.firUnsafe() }
|
||||||
annotations += context.annotationDeserializer.loadClassAnnotations(classProto)
|
annotations += context.annotationDeserializer.loadClassAnnotations(classProto)
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -43,7 +43,8 @@ class FirDeserializationContext(
|
|||||||
fun childContext(
|
fun childContext(
|
||||||
typeParameterProtos: List<ProtoBuf.TypeParameter>,
|
typeParameterProtos: List<ProtoBuf.TypeParameter>,
|
||||||
nameResolver: NameResolver = this.nameResolver,
|
nameResolver: NameResolver = this.nameResolver,
|
||||||
typeTable: TypeTable = this.typeTable
|
typeTable: TypeTable = this.typeTable,
|
||||||
|
relativeClassName: FqName? = this.relativeClassName
|
||||||
): FirDeserializationContext = FirDeserializationContext(
|
): FirDeserializationContext = FirDeserializationContext(
|
||||||
nameResolver, typeTable, versionRequirementTable, session, packageFqName, relativeClassName,
|
nameResolver, typeTable, versionRequirementTable, session, packageFqName, relativeClassName,
|
||||||
FirTypeDeserializer(
|
FirTypeDeserializer(
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fun main() {
|
||||||
|
val y = Int.MAX_VALUE
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
FILE: companionLoad.kt
|
||||||
|
public final fun main(): R|kotlin/Unit| {
|
||||||
|
lval y: R|kotlin/Int| = R|kotlin/Int|.R|kotlin/Int.Companion.MAX_VALUE|
|
||||||
|
}
|
||||||
Generated
+5
@@ -34,6 +34,11 @@ public class FirResolveTestCaseWithStdlibGenerated extends AbstractFirResolveTes
|
|||||||
runTest("compiler/fir/resolve/testData/resolve/stdlib/arrayFirstOrNull.kt");
|
runTest("compiler/fir/resolve/testData/resolve/stdlib/arrayFirstOrNull.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("companionLoad.kt")
|
||||||
|
public void testCompanionLoad() throws Exception {
|
||||||
|
runTest("compiler/fir/resolve/testData/resolve/stdlib/companionLoad.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("components.kt")
|
@TestMetadata("components.kt")
|
||||||
public void testComponents() throws Exception {
|
public void testComponents() throws Exception {
|
||||||
runTest("compiler/fir/resolve/testData/resolve/stdlib/components.kt");
|
runTest("compiler/fir/resolve/testData/resolve/stdlib/components.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user