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 {
|
||||
|
||||
val context =
|
||||
parentContext?.childContext(classProto.typeParameterList, nameResolver, TypeTable(classProto.typeTable))
|
||||
?: FirDeserializationContext.createForClass(
|
||||
classId, classProto, nameResolver, session, FirBuiltinAnnotationDeserializer(session, nameResolver)
|
||||
)
|
||||
parentContext?.childContext(
|
||||
classProto.typeParameterList,
|
||||
nameResolver,
|
||||
TypeTable(classProto.typeTable),
|
||||
classId.relativeClassName
|
||||
) ?: FirDeserializationContext.createForClass(
|
||||
classId, classProto, nameResolver, session, FirBuiltinAnnotationDeserializer(session, nameResolver)
|
||||
)
|
||||
typeParameters += context.typeDeserializer.ownTypeParameters.map { it.firUnsafe() }
|
||||
annotations += context.annotationDeserializer.loadClassAnnotations(classProto)
|
||||
|
||||
|
||||
+2
-1
@@ -43,7 +43,8 @@ class FirDeserializationContext(
|
||||
fun childContext(
|
||||
typeParameterProtos: List<ProtoBuf.TypeParameter>,
|
||||
nameResolver: NameResolver = this.nameResolver,
|
||||
typeTable: TypeTable = this.typeTable
|
||||
typeTable: TypeTable = this.typeTable,
|
||||
relativeClassName: FqName? = this.relativeClassName
|
||||
): FirDeserializationContext = FirDeserializationContext(
|
||||
nameResolver, typeTable, versionRequirementTable, session, packageFqName, relativeClassName,
|
||||
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");
|
||||
}
|
||||
|
||||
@TestMetadata("companionLoad.kt")
|
||||
public void testCompanionLoad() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/stdlib/companionLoad.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("components.kt")
|
||||
public void testComponents() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/stdlib/components.kt");
|
||||
|
||||
Reference in New Issue
Block a user