JVM_IR: fix deserialization of Java static field symbols
This commit is contained in:
committed by
TeamCityServer
parent
955ee07517
commit
fa4efd3303
+6
@@ -4118,6 +4118,12 @@ public class FirBlackBoxInlineCodegenTestGenerated extends AbstractFirBlackBoxIn
|
|||||||
runTest("compiler/testData/codegen/boxInline/simple/funImportedFromObject.kt");
|
runTest("compiler/testData/codegen/boxInline/simple/funImportedFromObject.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("importedJavaStaticField.kt")
|
||||||
|
public void testImportedJavaStaticField() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/boxInline/simple/importedJavaStaticField.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("inlineCallInInlineLambda.kt")
|
@TestMetadata("inlineCallInInlineLambda.kt")
|
||||||
public void testInlineCallInInlineLambda() throws Exception {
|
public void testInlineCallInInlineLambda() throws Exception {
|
||||||
|
|||||||
+1
-1
@@ -117,8 +117,8 @@ class DescriptorByIdSignatureFinder(
|
|||||||
if (isConstructorName(current)) addAll(classDescriptor.constructors)
|
if (isConstructorName(current)) addAll(classDescriptor.constructors)
|
||||||
addAll(memberScope.getContributedFunctions(current, NoLookupLocation.FROM_BACKEND))
|
addAll(memberScope.getContributedFunctions(current, NoLookupLocation.FROM_BACKEND))
|
||||||
addAll(memberScope.getContributedVariables(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 })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -443,7 +443,7 @@ class IrBodyDeserializer(
|
|||||||
val origin = if (proto.hasOriginName()) deserializeIrStatementOrigin(proto.originName) else null
|
val origin = if (proto.hasOriginName()) deserializeIrStatementOrigin(proto.originName) else null
|
||||||
|
|
||||||
val superQualifier = if (access.hasSuper()) {
|
val superQualifier = if (access.hasSuper()) {
|
||||||
declarationDeserializer.deserializeIrSymbolAndRemap(access.symbol) as IrClassSymbol
|
declarationDeserializer.deserializeIrSymbolAndRemap(access.`super`) as IrClassSymbol
|
||||||
} else null
|
} else null
|
||||||
val receiver = if (access.hasReceiver()) {
|
val receiver = if (access.hasReceiver()) {
|
||||||
deserializeExpression(access.receiver)
|
deserializeExpression(access.receiver)
|
||||||
@@ -549,7 +549,7 @@ class IrBodyDeserializer(
|
|||||||
val access = proto.fieldAccess
|
val access = proto.fieldAccess
|
||||||
val symbol = declarationDeserializer.deserializeIrSymbolAndRemap(access.symbol) as IrFieldSymbol
|
val symbol = declarationDeserializer.deserializeIrSymbolAndRemap(access.symbol) as IrFieldSymbol
|
||||||
val superQualifier = if (access.hasSuper()) {
|
val superQualifier = if (access.hasSuper()) {
|
||||||
declarationDeserializer.deserializeIrSymbolAndRemap(access.symbol) as IrClassSymbol
|
declarationDeserializer.deserializeIrSymbolAndRemap(access.`super`) as IrClassSymbol
|
||||||
} else null
|
} else null
|
||||||
val receiver = if (access.hasReceiver()) {
|
val receiver = if (access.hasReceiver()) {
|
||||||
deserializeExpression(access.receiver)
|
deserializeExpression(access.receiver)
|
||||||
|
|||||||
+3
-1
@@ -361,7 +361,9 @@ open class IrFileSerializer(
|
|||||||
is IrReturnableBlockSymbol ->
|
is IrReturnableBlockSymbol ->
|
||||||
BinarySymbolData.SymbolKind.RETURNABLE_BLOCK_SYMBOL
|
BinarySymbolData.SymbolKind.RETURNABLE_BLOCK_SYMBOL
|
||||||
is IrFieldSymbol ->
|
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
|
BinarySymbolData.SymbolKind.STANDALONE_FIELD_SYMBOL
|
||||||
else
|
else
|
||||||
BinarySymbolData.SymbolKind.FIELD_SYMBOL
|
BinarySymbolData.SymbolKind.FIELD_SYMBOL
|
||||||
|
|||||||
+4
-2
@@ -164,7 +164,8 @@ private fun referencePublicSymbol(
|
|||||||
BinarySymbolData.SymbolKind.CLASS_SYMBOL -> referenceClass(descriptor as ClassDescriptor)
|
BinarySymbolData.SymbolKind.CLASS_SYMBOL -> referenceClass(descriptor as ClassDescriptor)
|
||||||
BinarySymbolData.SymbolKind.CONSTRUCTOR_SYMBOL -> referenceConstructor(descriptor as ClassConstructorDescriptor)
|
BinarySymbolData.SymbolKind.CONSTRUCTOR_SYMBOL -> referenceConstructor(descriptor as ClassConstructorDescriptor)
|
||||||
BinarySymbolData.SymbolKind.ENUM_ENTRY_SYMBOL -> referenceEnumEntry(descriptor as ClassDescriptor)
|
BinarySymbolData.SymbolKind.ENUM_ENTRY_SYMBOL -> referenceEnumEntry(descriptor as ClassDescriptor)
|
||||||
BinarySymbolData.SymbolKind.STANDALONE_FIELD_SYMBOL -> referenceField(descriptor as PropertyDescriptor)
|
BinarySymbolData.SymbolKind.STANDALONE_FIELD_SYMBOL, BinarySymbolData.SymbolKind.FIELD_SYMBOL
|
||||||
|
-> referenceField(descriptor as PropertyDescriptor)
|
||||||
BinarySymbolData.SymbolKind.FUNCTION_SYMBOL -> referenceSimpleFunction(descriptor as FunctionDescriptor)
|
BinarySymbolData.SymbolKind.FUNCTION_SYMBOL -> referenceSimpleFunction(descriptor as FunctionDescriptor)
|
||||||
BinarySymbolData.SymbolKind.TYPEALIAS_SYMBOL -> referenceTypeAlias(descriptor as TypeAliasDescriptor)
|
BinarySymbolData.SymbolKind.TYPEALIAS_SYMBOL -> referenceTypeAlias(descriptor as TypeAliasDescriptor)
|
||||||
BinarySymbolData.SymbolKind.PROPERTY_SYMBOL -> referenceProperty(descriptor as PropertyDescriptor)
|
BinarySymbolData.SymbolKind.PROPERTY_SYMBOL -> referenceProperty(descriptor as PropertyDescriptor)
|
||||||
@@ -175,7 +176,8 @@ private fun referencePublicSymbol(
|
|||||||
BinarySymbolData.SymbolKind.CLASS_SYMBOL -> referenceClassFromLinker(idSig)
|
BinarySymbolData.SymbolKind.CLASS_SYMBOL -> referenceClassFromLinker(idSig)
|
||||||
BinarySymbolData.SymbolKind.CONSTRUCTOR_SYMBOL -> referenceConstructorFromLinker(idSig)
|
BinarySymbolData.SymbolKind.CONSTRUCTOR_SYMBOL -> referenceConstructorFromLinker(idSig)
|
||||||
BinarySymbolData.SymbolKind.ENUM_ENTRY_SYMBOL -> referenceEnumEntryFromLinker(idSig)
|
BinarySymbolData.SymbolKind.ENUM_ENTRY_SYMBOL -> referenceEnumEntryFromLinker(idSig)
|
||||||
BinarySymbolData.SymbolKind.STANDALONE_FIELD_SYMBOL -> referenceFieldFromLinker(idSig)
|
BinarySymbolData.SymbolKind.STANDALONE_FIELD_SYMBOL, BinarySymbolData.SymbolKind.FIELD_SYMBOL
|
||||||
|
-> referenceFieldFromLinker(idSig)
|
||||||
BinarySymbolData.SymbolKind.FUNCTION_SYMBOL -> referenceSimpleFunctionFromLinker(idSig)
|
BinarySymbolData.SymbolKind.FUNCTION_SYMBOL -> referenceSimpleFunctionFromLinker(idSig)
|
||||||
BinarySymbolData.SymbolKind.TYPEALIAS_SYMBOL -> referenceTypeAliasFromLinker(idSig)
|
BinarySymbolData.SymbolKind.TYPEALIAS_SYMBOL -> referenceTypeAliasFromLinker(idSig)
|
||||||
BinarySymbolData.SymbolKind.PROPERTY_SYMBOL -> referencePropertyFromLinker(idSig)
|
BinarySymbolData.SymbolKind.PROPERTY_SYMBOL -> referencePropertyFromLinker(idSig)
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
// TARGET_BACKEND: JVM_IR
|
||||||
|
// WITH_RUNTIME
|
||||||
|
// FILE: 1.kt
|
||||||
|
import java.util.Locale
|
||||||
|
|
||||||
|
inline fun inlineFun(): String {
|
||||||
|
val root = Locale.ROOT
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: 2.kt
|
||||||
|
fun box() = inlineFun()
|
||||||
+6
@@ -4118,6 +4118,12 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli
|
|||||||
runTest("compiler/testData/codegen/boxInline/simple/funImportedFromObject.kt");
|
runTest("compiler/testData/codegen/boxInline/simple/funImportedFromObject.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("importedJavaStaticField.kt")
|
||||||
|
public void testImportedJavaStaticField() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/boxInline/simple/importedJavaStaticField.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("inlineCallInInlineLambda.kt")
|
@TestMetadata("inlineCallInInlineLambda.kt")
|
||||||
public void testInlineCallInInlineLambda() throws Exception {
|
public void testInlineCallInInlineLambda() throws Exception {
|
||||||
|
|||||||
+6
@@ -4118,6 +4118,12 @@ public class IrCompileKotlinAgainstInlineKotlinTestGenerated extends AbstractIrC
|
|||||||
runTest("compiler/testData/codegen/boxInline/simple/funImportedFromObject.kt");
|
runTest("compiler/testData/codegen/boxInline/simple/funImportedFromObject.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("importedJavaStaticField.kt")
|
||||||
|
public void testImportedJavaStaticField() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/boxInline/simple/importedJavaStaticField.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("inlineCallInInlineLambda.kt")
|
@TestMetadata("inlineCallInInlineLambda.kt")
|
||||||
public void testInlineCallInInlineLambda() throws Exception {
|
public void testInlineCallInInlineLambda() throws Exception {
|
||||||
|
|||||||
+6
@@ -4016,6 +4016,12 @@ public class IrSerializeCompileKotlinAgainstInlineKotlinTestGenerated extends Ab
|
|||||||
runTest("compiler/testData/codegen/boxInline/simple/funImportedFromObject.kt");
|
runTest("compiler/testData/codegen/boxInline/simple/funImportedFromObject.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("importedJavaStaticField.kt")
|
||||||
|
public void testImportedJavaStaticField() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/boxInline/simple/importedJavaStaticField.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("inlineCallInInlineLambda.kt")
|
@TestMetadata("inlineCallInInlineLambda.kt")
|
||||||
public void testInlineCallInInlineLambda() throws Exception {
|
public void testInlineCallInInlineLambda() throws Exception {
|
||||||
|
|||||||
+6
@@ -4118,6 +4118,12 @@ public class JvmIrAgainstOldBoxInlineTestGenerated extends AbstractJvmIrAgainstO
|
|||||||
runTest("compiler/testData/codegen/boxInline/simple/funImportedFromObject.kt");
|
runTest("compiler/testData/codegen/boxInline/simple/funImportedFromObject.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("importedJavaStaticField.kt")
|
||||||
|
public void testImportedJavaStaticField() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/boxInline/simple/importedJavaStaticField.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("inlineCallInInlineLambda.kt")
|
@TestMetadata("inlineCallInInlineLambda.kt")
|
||||||
public void testInlineCallInInlineLambda() throws Exception {
|
public void testInlineCallInInlineLambda() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user