JVM_IR: fix deserialization of Java static field symbols

This commit is contained in:
Georgy Bronnikov
2021-06-24 14:01:46 +03:00
committed by TeamCityServer
parent 955ee07517
commit fa4efd3303
10 changed files with 52 additions and 6 deletions
@@ -117,8 +117,8 @@ class DescriptorByIdSignatureFinder(
if (isConstructorName(current)) addAll(classDescriptor.constructors)
addAll(memberScope.getContributedFunctions(current, NoLookupLocation.FROM_BACKEND))
addAll(memberScope.getContributedVariables(current, NoLookupLocation.FROM_BACKEND))
addAll(classDescriptor.staticScope.getContributedDescriptors { it == current })
}
addAll(classDescriptor.staticScope.getContributedDescriptors().filter { it.name == current })
}
}
}
@@ -443,7 +443,7 @@ class IrBodyDeserializer(
val origin = if (proto.hasOriginName()) deserializeIrStatementOrigin(proto.originName) else null
val superQualifier = if (access.hasSuper()) {
declarationDeserializer.deserializeIrSymbolAndRemap(access.symbol) as IrClassSymbol
declarationDeserializer.deserializeIrSymbolAndRemap(access.`super`) as IrClassSymbol
} else null
val receiver = if (access.hasReceiver()) {
deserializeExpression(access.receiver)
@@ -549,7 +549,7 @@ class IrBodyDeserializer(
val access = proto.fieldAccess
val symbol = declarationDeserializer.deserializeIrSymbolAndRemap(access.symbol) as IrFieldSymbol
val superQualifier = if (access.hasSuper()) {
declarationDeserializer.deserializeIrSymbolAndRemap(access.symbol) as IrClassSymbol
declarationDeserializer.deserializeIrSymbolAndRemap(access.`super`) as IrClassSymbol
} else null
val receiver = if (access.hasReceiver()) {
deserializeExpression(access.receiver)
@@ -361,7 +361,9 @@ open class IrFileSerializer(
is IrReturnableBlockSymbol ->
BinarySymbolData.SymbolKind.RETURNABLE_BLOCK_SYMBOL
is IrFieldSymbol ->
if (symbol.owner.correspondingPropertySymbol?.owner.let { it == null || it.isDelegated })
if (symbol.owner.correspondingPropertySymbol?.owner.let {
it == null || it.isDelegated || it.getter == null && it.setter == null
})
BinarySymbolData.SymbolKind.STANDALONE_FIELD_SYMBOL
else
BinarySymbolData.SymbolKind.FIELD_SYMBOL