Rename several core entities as a part of kx.serialization abi change
This commit is contained in:
+1
-1
@@ -726,7 +726,7 @@ interface IrBuilderExtension {
|
|||||||
|
|
||||||
private fun IrConstructor.isSerializationCtor(): Boolean {
|
private fun IrConstructor.isSerializationCtor(): Boolean {
|
||||||
val serialMarker =
|
val serialMarker =
|
||||||
compilerContext.referenceClass(SerializationPackages.packageFqName.child(SerialEntityNames.SERIAL_CTOR_MARKER_NAME))
|
compilerContext.referenceClass(SerializationPackages.internalPackageFqName.child(SerialEntityNames.SERIAL_CTOR_MARKER_NAME))
|
||||||
|
|
||||||
return valueParameters.lastOrNull()?.run {
|
return valueParameters.lastOrNull()?.run {
|
||||||
name == SerialEntityNames.dummyParamName && type.classifierOrNull == serialMarker
|
name == SerialEntityNames.dummyParamName && type.classifierOrNull == serialMarker
|
||||||
|
|||||||
+2
-2
@@ -126,7 +126,7 @@ internal fun InstructionAdapter.buildInternalConstructorDesc(
|
|||||||
load(propVar, propertyType)
|
load(propVar, propertyType)
|
||||||
propVar += propertyType.size
|
propVar += propertyType.size
|
||||||
}
|
}
|
||||||
constructorDesc.append("Lkotlinx/serialization/$SERIAL_CTOR_MARKER_NAME;)V")
|
constructorDesc.append("Lkotlinx/serialization/internal/$SERIAL_CTOR_MARKER_NAME;)V")
|
||||||
aconst(null)
|
aconst(null)
|
||||||
return constructorDesc.toString()
|
return constructorDesc.toString()
|
||||||
}
|
}
|
||||||
@@ -373,7 +373,7 @@ internal fun AbstractSerialGenerator.stackValueSerializerInstance(codegen: Class
|
|||||||
|
|
||||||
fun InstructionAdapter.wrapStackValueIntoNullableSerializer() =
|
fun InstructionAdapter.wrapStackValueIntoNullableSerializer() =
|
||||||
invokestatic(
|
invokestatic(
|
||||||
"kotlinx/serialization/internal/NullableSerializerKt", "makeNullable",
|
"kotlinx/serialization/builtins/BuiltinSerializersKt", "getNullable",
|
||||||
"(" + kSerializerType.descriptor + ")" + kSerializerType.descriptor, false
|
"(" + kSerializerType.descriptor + ")" + kSerializerType.descriptor, false
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -59,7 +59,7 @@ object SerialEntityNames {
|
|||||||
const val SERIAL_LOADER_CLASS = "DeserializationStrategy"
|
const val SERIAL_LOADER_CLASS = "DeserializationStrategy"
|
||||||
|
|
||||||
const val SERIAL_DESCRIPTOR_CLASS = "SerialDescriptor"
|
const val SERIAL_DESCRIPTOR_CLASS = "SerialDescriptor"
|
||||||
const val SERIAL_DESCRIPTOR_CLASS_IMPL = "SerialClassDescImpl"
|
const val SERIAL_DESCRIPTOR_CLASS_IMPL = "PluginGeneratedSerialDescriptor"
|
||||||
const val SERIAL_DESCRIPTOR_FOR_ENUM = "EnumDescriptor"
|
const val SERIAL_DESCRIPTOR_FOR_ENUM = "EnumDescriptor"
|
||||||
|
|
||||||
//exceptions
|
//exceptions
|
||||||
|
|||||||
+9
-4
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||||
* that can be found in the license/LICENSE.txt file.
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.jetbrains.kotlinx.serialization.compiler.resolve
|
package org.jetbrains.kotlinx.serialization.compiler.resolve
|
||||||
@@ -23,7 +23,7 @@ internal fun ClassConstructorDescriptor.isSerializationCtor(): Boolean {
|
|||||||
/*kind == CallableMemberDescriptor.Kind.SYNTHESIZED does not work because DeserializedClassConstructorDescriptor loses its kind*/
|
/*kind == CallableMemberDescriptor.Kind.SYNTHESIZED does not work because DeserializedClassConstructorDescriptor loses its kind*/
|
||||||
return valueParameters.lastOrNull()?.run {
|
return valueParameters.lastOrNull()?.run {
|
||||||
name == SerialEntityNames.dummyParamName && type.constructor.declarationDescriptor?.classId == ClassId(
|
name == SerialEntityNames.dummyParamName && type.constructor.declarationDescriptor?.classId == ClassId(
|
||||||
SerializationPackages.packageFqName,
|
SerializationPackages.internalPackageFqName,
|
||||||
SerialEntityNames.SERIAL_CTOR_MARKER_NAME
|
SerialEntityNames.SERIAL_CTOR_MARKER_NAME
|
||||||
)
|
)
|
||||||
} == true
|
} == true
|
||||||
@@ -61,7 +61,12 @@ internal fun Annotations.findAnnotationKotlinTypeValue(
|
|||||||
}
|
}
|
||||||
|
|
||||||
internal fun ClassDescriptor.getKSerializerConstructorMarker(): ClassDescriptor =
|
internal fun ClassDescriptor.getKSerializerConstructorMarker(): ClassDescriptor =
|
||||||
module.findClassAcrossModuleDependencies(ClassId(SerializationPackages.packageFqName, SerialEntityNames.SERIAL_CTOR_MARKER_NAME))!!
|
module.findClassAcrossModuleDependencies(
|
||||||
|
ClassId(
|
||||||
|
SerializationPackages.internalPackageFqName,
|
||||||
|
SerialEntityNames.SERIAL_CTOR_MARKER_NAME
|
||||||
|
)
|
||||||
|
)!!
|
||||||
|
|
||||||
internal fun getInternalPackageFqn(classSimpleName: String): FqName =
|
internal fun getInternalPackageFqn(classSimpleName: String): FqName =
|
||||||
SerializationPackages.internalPackageFqName.child(Name.identifier(classSimpleName))
|
SerializationPackages.internalPackageFqName.child(Name.identifier(classSimpleName))
|
||||||
|
|||||||
Reference in New Issue
Block a user