Add inspections and quickfixes of redundant Json format instantiation
Resolves KT-45075
This commit is contained in:
@@ -21,7 +21,7 @@ dependencies {
|
||||
|
||||
testCompile(projectTests(":compiler:tests-common"))
|
||||
testCompile(commonDep("junit:junit"))
|
||||
testImplementation("org.jetbrains.kotlinx:kotlinx-serialization-runtime-jvm:1.0-M1-1.4.0-rc") { isTransitive = false }
|
||||
testImplementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.1.0")
|
||||
|
||||
testRuntimeOnly(intellijCoreDep()) { includeJars("intellij-core") }
|
||||
testRuntimeOnly(intellijDep()) { includeJars("platform-concurrency") }
|
||||
|
||||
+3
-1
@@ -29,6 +29,8 @@ public interface SerializationErrors {
|
||||
DiagnosticFactory0<PsiElement> TRANSIENT_MISSING_INITIALIZER = DiagnosticFactory0.create(ERROR);
|
||||
|
||||
DiagnosticFactory0<PsiElement> TRANSIENT_IS_REDUNDANT = DiagnosticFactory0.create(WARNING);
|
||||
DiagnosticFactory0<PsiElement> JSON_FORMAT_REDUNDANT_DEFAULT = DiagnosticFactory0.create(WARNING);
|
||||
DiagnosticFactory0<PsiElement> JSON_FORMAT_REDUNDANT = DiagnosticFactory0.create(WARNING);
|
||||
|
||||
DiagnosticFactory0<PsiElement> INCORRECT_TRANSIENT = DiagnosticFactory0.create(WARNING);
|
||||
|
||||
@@ -42,4 +44,4 @@ public interface SerializationErrors {
|
||||
.initializeFactoryNamesAndDefaultErrorMessages(SerializationErrors.class, SerializationPluginErrorsRendering.INSTANCE);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+9
-1
@@ -74,6 +74,14 @@ object SerializationPluginErrorsRendering : DefaultErrorMessages.Extension {
|
||||
SerializationErrors.TRANSIENT_IS_REDUNDANT,
|
||||
"Property does not have backing field which makes it non-serializable and therefore @Transient is redundant"
|
||||
)
|
||||
MAP.put(
|
||||
SerializationErrors.JSON_FORMAT_REDUNDANT_DEFAULT,
|
||||
"Redundant creation of Json default format. Creating instances for each usage can be slow."
|
||||
)
|
||||
MAP.put(
|
||||
SerializationErrors.JSON_FORMAT_REDUNDANT,
|
||||
"Redundant creation of Json format. Creating instances for each usage can be slow."
|
||||
)
|
||||
MAP.put(
|
||||
SerializationErrors.INCORRECT_TRANSIENT,
|
||||
"@kotlin.jvm.Transient does not affect @Serializable classes. Please use @kotlinx.serialization.Transient instead."
|
||||
@@ -96,4 +104,4 @@ object SerializationPluginErrorsRendering : DefaultErrorMessages.Extension {
|
||||
Renderers.STRING
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -13,7 +13,7 @@ import org.jetbrains.kotlinx.serialization.compiler.extensions.SerializationComp
|
||||
import java.io.File
|
||||
|
||||
abstract class AbstractSerializationIrBytecodeListingTest : AbstractAsmLikeInstructionListingTest() {
|
||||
private val runtimeLibraryPath = getSerializationLibraryRuntimeJar()
|
||||
private val coreLibraryPath = getSerializationCoreLibraryJar()
|
||||
|
||||
override fun getExpectedTextFileName(wholeFile: File): String {
|
||||
return wholeFile.nameWithoutExtension + ".ir.txt"
|
||||
@@ -23,6 +23,6 @@ abstract class AbstractSerializationIrBytecodeListingTest : AbstractAsmLikeInstr
|
||||
|
||||
override fun setupEnvironment(environment: KotlinCoreEnvironment) {
|
||||
SerializationComponentRegistrar.registerExtensions(environment.project)
|
||||
environment.updateClasspath(listOf(JvmClasspathRoot(runtimeLibraryPath!!)))
|
||||
environment.updateClasspath(listOf(JvmClasspathRoot(coreLibraryPath!!)))
|
||||
}
|
||||
}
|
||||
|
||||
+3
-4
@@ -5,17 +5,16 @@
|
||||
|
||||
package org.jetbrains.kotlinx.serialization
|
||||
|
||||
import junit.framework.TestCase
|
||||
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment
|
||||
import org.jetbrains.kotlin.cli.jvm.config.JvmClasspathRoot
|
||||
import org.jetbrains.kotlin.codegen.AbstractAsmLikeInstructionListingTest
|
||||
import org.jetbrains.kotlinx.serialization.compiler.extensions.SerializationComponentRegistrar
|
||||
|
||||
abstract class AbstractSerializationPluginBytecodeListingTest : AbstractAsmLikeInstructionListingTest() {
|
||||
private val runtimeLibraryPath = getSerializationLibraryRuntimeJar()
|
||||
private val coreLibraryPath = getSerializationCoreLibraryJar()
|
||||
|
||||
override fun setupEnvironment(environment: KotlinCoreEnvironment) {
|
||||
SerializationComponentRegistrar.registerExtensions(environment.project)
|
||||
environment.updateClasspath(listOf(JvmClasspathRoot(runtimeLibraryPath!!)))
|
||||
environment.updateClasspath(listOf(JvmClasspathRoot(coreLibraryPath!!)))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -13,10 +13,10 @@ import org.jetbrains.kotlinx.serialization.compiler.extensions.SerializationComp
|
||||
|
||||
@OptIn(ObsoleteTestInfrastructure::class)
|
||||
abstract class AbstractSerializationPluginDiagnosticTest : AbstractDiagnosticsTest() {
|
||||
private val runtimeLibraryPath = getSerializationLibraryRuntimeJar()
|
||||
private val coreLibraryPath = getSerializationCoreLibraryJar()
|
||||
|
||||
override fun setupEnvironment(environment: KotlinCoreEnvironment) {
|
||||
SerializationComponentRegistrar.registerExtensions(environment.project)
|
||||
environment.updateClasspath(listOf(JvmClasspathRoot(runtimeLibraryPath!!)))
|
||||
environment.updateClasspath(listOf(JvmClasspathRoot(coreLibraryPath!!)))
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -13,25 +13,25 @@ import java.io.File
|
||||
import kotlin.test.assertTrue
|
||||
|
||||
class RuntimeLibraryInClasspathTest {
|
||||
private val runtimeLibraryPath = getSerializationLibraryRuntimeJar()
|
||||
private val coreLibraryPath = getSerializationCoreLibraryJar()
|
||||
|
||||
@Test
|
||||
fun testRuntimeLibraryExists() {
|
||||
TestCase.assertNotNull(
|
||||
"kotlinx-serialization runtime library is not found. Make sure it is present in test classpath",
|
||||
runtimeLibraryPath
|
||||
coreLibraryPath
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testRuntimeHasSufficientVersion() {
|
||||
val version = VersionReader.getVersionsFromManifest(runtimeLibraryPath!!)
|
||||
val version = VersionReader.getVersionsFromManifest(coreLibraryPath!!)
|
||||
assertTrue(version.currentCompilerMatchRequired(), "Runtime version too high")
|
||||
assertTrue(version.implementationVersionMatchSupported(), "Runtime version too low")
|
||||
}
|
||||
}
|
||||
|
||||
internal fun getSerializationLibraryRuntimeJar(): File? = try {
|
||||
internal fun getSerializationCoreLibraryJar(): File? = try {
|
||||
PathUtil.getResourcePathForClass(Class.forName("kotlinx.serialization.KSerializer"))
|
||||
} catch (e: ClassNotFoundException) {
|
||||
null
|
||||
|
||||
+39
-49
@@ -165,10 +165,6 @@ public final class ListOfUsers$$serializer : java/lang/Object, kotlinx/serializa
|
||||
|
||||
public kotlinx.serialization.descriptors.SerialDescriptor getDescriptor()
|
||||
|
||||
public ListOfUsers patch(kotlinx.serialization.encoding.Decoder decoder, ListOfUsers old)
|
||||
|
||||
public java.lang.Object patch(kotlinx.serialization.encoding.Decoder decoder, java.lang.Object old)
|
||||
|
||||
public void serialize(kotlinx.serialization.encoding.Encoder encoder, ListOfUsers value) {
|
||||
LABEL (L0)
|
||||
ALOAD (1)
|
||||
@@ -276,18 +272,19 @@ public final class ListOfUsers : java/lang/Object {
|
||||
public void <init>(int seen1, java.util.List list, kotlinx.serialization.internal.SerializationConstructorMarker serializationConstructorMarker) {
|
||||
LABEL (L0)
|
||||
LINENUMBER (12)
|
||||
ALOAD (0)
|
||||
INVOKESPECIAL (java/lang/Object, <init>, ()V)
|
||||
ICONST_1
|
||||
ICONST_1
|
||||
ILOAD (1)
|
||||
IAND
|
||||
IF_ICMPEQ (L1)
|
||||
ILOAD (1)
|
||||
ICONST_1
|
||||
IAND
|
||||
IFNE (L1)
|
||||
NEW
|
||||
DUP
|
||||
LDC (list)
|
||||
INVOKESPECIAL (kotlinx/serialization/MissingFieldException, <init>, (Ljava/lang/String;)V)
|
||||
ATHROW
|
||||
GETSTATIC (INSTANCE, LListOfUsers$$serializer;)
|
||||
INVOKEVIRTUAL (ListOfUsers$$serializer, getDescriptor, ()Lkotlinx/serialization/descriptors/SerialDescriptor;)
|
||||
INVOKESTATIC (kotlinx/serialization/internal/PluginExceptionsKt, throwMissingFieldException, (IILkotlinx/serialization/descriptors/SerialDescriptor;)V)
|
||||
LABEL (L1)
|
||||
ALOAD (0)
|
||||
INVOKESPECIAL (java/lang/Object, <init>, ()V)
|
||||
ALOAD (0)
|
||||
ALOAD (2)
|
||||
PUTFIELD (list, Ljava/util/List;)
|
||||
@@ -453,10 +450,6 @@ public final class OptionalUser$$serializer : java/lang/Object, kotlinx/serializ
|
||||
|
||||
public kotlinx.serialization.descriptors.SerialDescriptor getDescriptor()
|
||||
|
||||
public OptionalUser patch(kotlinx.serialization.encoding.Decoder decoder, OptionalUser old)
|
||||
|
||||
public java.lang.Object patch(kotlinx.serialization.encoding.Decoder decoder, java.lang.Object old)
|
||||
|
||||
public void serialize(kotlinx.serialization.encoding.Encoder encoder, OptionalUser value) {
|
||||
LABEL (L0)
|
||||
ALOAD (1)
|
||||
@@ -608,31 +601,41 @@ public final class OptionalUser : java/lang/Object {
|
||||
public void <init>(int seen1, User user, kotlinx.serialization.internal.SerializationConstructorMarker serializationConstructorMarker) {
|
||||
LABEL (L0)
|
||||
LINENUMBER (9)
|
||||
ICONST_0
|
||||
ILOAD (1)
|
||||
IAND
|
||||
IFEQ (L1)
|
||||
ILOAD (1)
|
||||
ICONST_0
|
||||
GETSTATIC (INSTANCE, LOptionalUser$$serializer;)
|
||||
INVOKEVIRTUAL (OptionalUser$$serializer, getDescriptor, ()Lkotlinx/serialization/descriptors/SerialDescriptor;)
|
||||
INVOKESTATIC (kotlinx/serialization/internal/PluginExceptionsKt, throwMissingFieldException, (IILkotlinx/serialization/descriptors/SerialDescriptor;)V)
|
||||
LABEL (L1)
|
||||
ALOAD (0)
|
||||
INVOKESPECIAL (java/lang/Object, <init>, ()V)
|
||||
ILOAD (1)
|
||||
ICONST_1
|
||||
IAND
|
||||
IFNE (L1)
|
||||
IFNE (L2)
|
||||
ALOAD (0)
|
||||
LABEL (L2)
|
||||
LABEL (L3)
|
||||
LINENUMBER (10)
|
||||
NEW
|
||||
DUP
|
||||
LDC ()
|
||||
LDC ()
|
||||
INVOKESPECIAL (User, <init>, (Ljava/lang/String;Ljava/lang/String;)V)
|
||||
LABEL (L3)
|
||||
LABEL (L4)
|
||||
LINENUMBER (9)
|
||||
PUTFIELD (user, LUser;)
|
||||
GOTO (L4)
|
||||
LABEL (L1)
|
||||
GOTO (L5)
|
||||
LABEL (L2)
|
||||
ALOAD (0)
|
||||
ALOAD (2)
|
||||
PUTFIELD (user, LUser;)
|
||||
LABEL (L4)
|
||||
RETURN
|
||||
LABEL (L5)
|
||||
RETURN
|
||||
LABEL (L6)
|
||||
}
|
||||
|
||||
public void <init>() {
|
||||
@@ -829,10 +832,6 @@ public final class User$$serializer : java/lang/Object, kotlinx/serialization/in
|
||||
|
||||
public kotlinx.serialization.descriptors.SerialDescriptor getDescriptor()
|
||||
|
||||
public User patch(kotlinx.serialization.encoding.Decoder decoder, User old)
|
||||
|
||||
public java.lang.Object patch(kotlinx.serialization.encoding.Decoder decoder, java.lang.Object old)
|
||||
|
||||
public void serialize(kotlinx.serialization.encoding.Encoder encoder, User value) {
|
||||
LABEL (L0)
|
||||
ALOAD (1)
|
||||
@@ -948,36 +947,27 @@ public final class User : java/lang/Object {
|
||||
public void <init>(int seen1, java.lang.String firstName, java.lang.String lastName, kotlinx.serialization.internal.SerializationConstructorMarker serializationConstructorMarker) {
|
||||
LABEL (L0)
|
||||
LINENUMBER (6)
|
||||
ICONST_3
|
||||
ICONST_3
|
||||
ILOAD (1)
|
||||
IAND
|
||||
IF_ICMPEQ (L1)
|
||||
ILOAD (1)
|
||||
ICONST_3
|
||||
GETSTATIC (INSTANCE, LUser$$serializer;)
|
||||
INVOKEVIRTUAL (User$$serializer, getDescriptor, ()Lkotlinx/serialization/descriptors/SerialDescriptor;)
|
||||
INVOKESTATIC (kotlinx/serialization/internal/PluginExceptionsKt, throwMissingFieldException, (IILkotlinx/serialization/descriptors/SerialDescriptor;)V)
|
||||
LABEL (L1)
|
||||
ALOAD (0)
|
||||
INVOKESPECIAL (java/lang/Object, <init>, ()V)
|
||||
ILOAD (1)
|
||||
ICONST_1
|
||||
IAND
|
||||
IFNE (L1)
|
||||
NEW
|
||||
DUP
|
||||
LDC (firstName)
|
||||
INVOKESPECIAL (kotlinx/serialization/MissingFieldException, <init>, (Ljava/lang/String;)V)
|
||||
ATHROW
|
||||
LABEL (L1)
|
||||
ALOAD (0)
|
||||
ALOAD (2)
|
||||
PUTFIELD (firstName, Ljava/lang/String;)
|
||||
ILOAD (1)
|
||||
ICONST_2
|
||||
IAND
|
||||
IFNE (L2)
|
||||
NEW
|
||||
DUP
|
||||
LDC (lastName)
|
||||
INVOKESPECIAL (kotlinx/serialization/MissingFieldException, <init>, (Ljava/lang/String;)V)
|
||||
ATHROW
|
||||
LABEL (L2)
|
||||
ALOAD (0)
|
||||
ALOAD (3)
|
||||
PUTFIELD (lastName, Ljava/lang/String;)
|
||||
RETURN
|
||||
LABEL (L3)
|
||||
LABEL (L2)
|
||||
}
|
||||
|
||||
public final java.lang.String getFirstName()
|
||||
|
||||
+41
-50
@@ -144,10 +144,6 @@ public final class ListOfUsers$$serializer : java/lang/Object, kotlinx/serializa
|
||||
|
||||
public kotlinx.serialization.descriptors.SerialDescriptor getDescriptor()
|
||||
|
||||
public ListOfUsers patch(kotlinx.serialization.encoding.Decoder decoder, ListOfUsers old)
|
||||
|
||||
public java.lang.Object patch(kotlinx.serialization.encoding.Decoder p0, java.lang.Object p1)
|
||||
|
||||
public void serialize(kotlinx.serialization.encoding.Encoder encoder, ListOfUsers value) {
|
||||
LABEL (L0)
|
||||
ALOAD (1)
|
||||
@@ -241,19 +237,20 @@ public final class ListOfUsers : java/lang/Object {
|
||||
|
||||
public void <init>(int seen1, java.util.List list, kotlinx.serialization.internal.SerializationConstructorMarker serializationConstructorMarker) {
|
||||
LABEL (L0)
|
||||
ALOAD (0)
|
||||
INVOKESPECIAL (java/lang/Object, <init>, ()V)
|
||||
ICONST_1
|
||||
DUP
|
||||
ILOAD (1)
|
||||
IAND
|
||||
IF_ICMPEQ (L1)
|
||||
ILOAD (1)
|
||||
ICONST_1
|
||||
IAND
|
||||
IFNE (L1)
|
||||
NEW
|
||||
DUP
|
||||
LDC (list)
|
||||
INVOKESPECIAL (kotlinx/serialization/MissingFieldException, <init>, (Ljava/lang/String;)V)
|
||||
GETSTATIC (INSTANCE, LListOfUsers$$serializer;)
|
||||
CHECKCAST
|
||||
ATHROW
|
||||
INVOKEINTERFACE (kotlinx/serialization/KSerializer, getDescriptor, ()Lkotlinx/serialization/descriptors/SerialDescriptor;)
|
||||
INVOKESTATIC (kotlinx/serialization/internal/PluginExceptionsKt, throwMissingFieldException, (IILkotlinx/serialization/descriptors/SerialDescriptor;)V)
|
||||
LABEL (L1)
|
||||
ALOAD (0)
|
||||
INVOKESPECIAL (java/lang/Object, <init>, ()V)
|
||||
ALOAD (0)
|
||||
ALOAD (2)
|
||||
PUTFIELD (list, Ljava/util/List;)
|
||||
@@ -427,10 +424,6 @@ public final class OptionalUser$$serializer : java/lang/Object, kotlinx/serializ
|
||||
|
||||
public kotlinx.serialization.descriptors.SerialDescriptor getDescriptor()
|
||||
|
||||
public OptionalUser patch(kotlinx.serialization.encoding.Decoder decoder, OptionalUser old)
|
||||
|
||||
public java.lang.Object patch(kotlinx.serialization.encoding.Decoder p0, java.lang.Object p1)
|
||||
|
||||
public void serialize(kotlinx.serialization.encoding.Encoder encoder, OptionalUser value) {
|
||||
LABEL (L0)
|
||||
ALOAD (1)
|
||||
@@ -553,19 +546,31 @@ public final class OptionalUser : java/lang/Object {
|
||||
|
||||
public void <init>(int seen1, User user, kotlinx.serialization.internal.SerializationConstructorMarker serializationConstructorMarker) {
|
||||
LABEL (L0)
|
||||
ICONST_0
|
||||
DUP
|
||||
ILOAD (1)
|
||||
IAND
|
||||
IF_ICMPEQ (L1)
|
||||
ILOAD (1)
|
||||
ICONST_0
|
||||
GETSTATIC (INSTANCE, LOptionalUser$$serializer;)
|
||||
CHECKCAST
|
||||
INVOKEINTERFACE (kotlinx/serialization/KSerializer, getDescriptor, ()Lkotlinx/serialization/descriptors/SerialDescriptor;)
|
||||
INVOKESTATIC (kotlinx/serialization/internal/PluginExceptionsKt, throwMissingFieldException, (IILkotlinx/serialization/descriptors/SerialDescriptor;)V)
|
||||
LABEL (L1)
|
||||
ALOAD (0)
|
||||
INVOKESPECIAL (java/lang/Object, <init>, ()V)
|
||||
ILOAD (1)
|
||||
ICONST_1
|
||||
IAND
|
||||
IFEQ (L1)
|
||||
IFEQ (L2)
|
||||
ALOAD (0)
|
||||
ALOAD (2)
|
||||
PUTFIELD (user, LUser;)
|
||||
GOTO (L2)
|
||||
LABEL (L1)
|
||||
GOTO (L3)
|
||||
LABEL (L2)
|
||||
ALOAD (0)
|
||||
LABEL (L3)
|
||||
LABEL (L4)
|
||||
LINENUMBER (10)
|
||||
NEW
|
||||
DUP
|
||||
@@ -573,9 +578,9 @@ public final class OptionalUser : java/lang/Object {
|
||||
LDC ()
|
||||
INVOKESPECIAL (User, <init>, (Ljava/lang/String;Ljava/lang/String;)V)
|
||||
PUTFIELD (user, LUser;)
|
||||
LABEL (L2)
|
||||
LABEL (L3)
|
||||
RETURN
|
||||
LABEL (L4)
|
||||
LABEL (L5)
|
||||
}
|
||||
|
||||
public final User getUser()
|
||||
@@ -781,10 +786,6 @@ public final class User$$serializer : java/lang/Object, kotlinx/serialization/in
|
||||
|
||||
public kotlinx.serialization.descriptors.SerialDescriptor getDescriptor()
|
||||
|
||||
public User patch(kotlinx.serialization.encoding.Decoder decoder, User old)
|
||||
|
||||
public java.lang.Object patch(kotlinx.serialization.encoding.Decoder p0, java.lang.Object p1)
|
||||
|
||||
public void serialize(kotlinx.serialization.encoding.Encoder encoder, User value) {
|
||||
LABEL (L0)
|
||||
ALOAD (1)
|
||||
@@ -886,38 +887,28 @@ public final class User : java/lang/Object {
|
||||
|
||||
public void <init>(int seen1, java.lang.String firstName, java.lang.String lastName, kotlinx.serialization.internal.SerializationConstructorMarker serializationConstructorMarker) {
|
||||
LABEL (L0)
|
||||
ICONST_3
|
||||
DUP
|
||||
ILOAD (1)
|
||||
IAND
|
||||
IF_ICMPEQ (L1)
|
||||
ILOAD (1)
|
||||
ICONST_3
|
||||
GETSTATIC (INSTANCE, LUser$$serializer;)
|
||||
CHECKCAST
|
||||
INVOKEINTERFACE (kotlinx/serialization/KSerializer, getDescriptor, ()Lkotlinx/serialization/descriptors/SerialDescriptor;)
|
||||
INVOKESTATIC (kotlinx/serialization/internal/PluginExceptionsKt, throwMissingFieldException, (IILkotlinx/serialization/descriptors/SerialDescriptor;)V)
|
||||
LABEL (L1)
|
||||
ALOAD (0)
|
||||
INVOKESPECIAL (java/lang/Object, <init>, ()V)
|
||||
ILOAD (1)
|
||||
ICONST_1
|
||||
IAND
|
||||
IFNE (L1)
|
||||
NEW
|
||||
DUP
|
||||
LDC (firstName)
|
||||
INVOKESPECIAL (kotlinx/serialization/MissingFieldException, <init>, (Ljava/lang/String;)V)
|
||||
CHECKCAST
|
||||
ATHROW
|
||||
LABEL (L1)
|
||||
ALOAD (0)
|
||||
ALOAD (2)
|
||||
PUTFIELD (firstName, Ljava/lang/String;)
|
||||
ILOAD (1)
|
||||
ICONST_2
|
||||
IAND
|
||||
IFNE (L2)
|
||||
NEW
|
||||
DUP
|
||||
LDC (lastName)
|
||||
INVOKESPECIAL (kotlinx/serialization/MissingFieldException, <init>, (Ljava/lang/String;)V)
|
||||
CHECKCAST
|
||||
ATHROW
|
||||
LABEL (L2)
|
||||
ALOAD (0)
|
||||
ALOAD (3)
|
||||
PUTFIELD (lastName, Ljava/lang/String;)
|
||||
RETURN
|
||||
LABEL (L3)
|
||||
LABEL (L2)
|
||||
}
|
||||
|
||||
public final java.lang.String getFirstName()
|
||||
|
||||
-2
@@ -15,7 +15,6 @@ package
|
||||
public open override /*1*/ /*synthesized*/ fun deserialize(/*0*/ decoder: kotlinx.serialization.encoding.Decoder): Derived
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
@kotlin.Deprecated(level = DeprecationLevel.ERROR, message = "Patch function is deprecated for removal since this functionality is no longer supported by serializer.Some formats may provide implementation-specific patching in their Decoders.") public open override /*1*/ /*fake_override*/ fun patch(/*0*/ decoder: kotlinx.serialization.encoding.Decoder, /*1*/ old: Derived): Derived
|
||||
public open override /*1*/ /*synthesized*/ fun serialize(/*0*/ encoder: kotlinx.serialization.encoding.Encoder, /*1*/ value: Derived): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun typeParametersSerializers(): kotlin.Array<kotlinx.serialization.KSerializer<*>>
|
||||
@@ -45,7 +44,6 @@ package
|
||||
public open override /*1*/ /*synthesized*/ fun deserialize(/*0*/ decoder: kotlinx.serialization.encoding.Decoder): Parent
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
@kotlin.Deprecated(level = DeprecationLevel.ERROR, message = "Patch function is deprecated for removal since this functionality is no longer supported by serializer.Some formats may provide implementation-specific patching in their Decoders.") public open override /*1*/ /*fake_override*/ fun patch(/*0*/ decoder: kotlinx.serialization.encoding.Decoder, /*1*/ old: Parent): Parent
|
||||
public open override /*1*/ /*synthesized*/ fun serialize(/*0*/ encoder: kotlinx.serialization.encoding.Encoder, /*1*/ value: Parent): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun typeParametersSerializers(): kotlin.Array<kotlinx.serialization.KSerializer<*>>
|
||||
|
||||
Vendored
+1
@@ -1,4 +1,5 @@
|
||||
// This test enshures that analysis ends up without compiler exceptions
|
||||
// !DIAGNOSTICS: -EXPERIMENTAL_API_USAGE
|
||||
|
||||
import kotlinx.serialization.*
|
||||
|
||||
|
||||
plugins/kotlin-serialization/kotlin-serialization-compiler/testData/diagnostics/LazyRecursionBug.txt
Vendored
-1
@@ -13,7 +13,6 @@ package
|
||||
public open override /*1*/ /*synthesized*/ fun deserialize(/*0*/ decoder: kotlinx.serialization.encoding.Decoder): Digest
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
@kotlin.Deprecated(level = DeprecationLevel.ERROR, message = "Patch function is deprecated for removal since this functionality is no longer supported by serializer.Some formats may provide implementation-specific patching in their Decoders.") public open override /*1*/ /*fake_override*/ fun patch(/*0*/ decoder: kotlinx.serialization.encoding.Decoder, /*1*/ old: Digest): Digest
|
||||
public open override /*1*/ /*synthesized*/ fun serialize(/*0*/ encoder: kotlinx.serialization.encoding.Encoder, /*1*/ value: Digest): kotlin.Unit
|
||||
public final /*synthesized*/ fun serializer(): kotlinx.serialization.KSerializer<Digest>
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
-1
@@ -16,7 +16,6 @@ package
|
||||
public open override /*1*/ /*synthesized*/ fun deserialize(/*0*/ decoder: kotlinx.serialization.encoding.Decoder): Derived
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
@kotlin.Deprecated(level = DeprecationLevel.ERROR, message = "Patch function is deprecated for removal since this functionality is no longer supported by serializer.Some formats may provide implementation-specific patching in their Decoders.") public open override /*1*/ /*fake_override*/ fun patch(/*0*/ decoder: kotlinx.serialization.encoding.Decoder, /*1*/ old: Derived): Derived
|
||||
public open override /*1*/ /*synthesized*/ fun serialize(/*0*/ encoder: kotlinx.serialization.encoding.Encoder, /*1*/ value: Derived): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun typeParametersSerializers(): kotlin.Array<kotlinx.serialization.KSerializer<*>>
|
||||
|
||||
Vendored
-3
@@ -15,7 +15,6 @@ package
|
||||
public open override /*1*/ /*synthesized*/ fun deserialize(/*0*/ decoder: kotlinx.serialization.encoding.Decoder): Basic
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
@kotlin.Deprecated(level = DeprecationLevel.ERROR, message = "Patch function is deprecated for removal since this functionality is no longer supported by serializer.Some formats may provide implementation-specific patching in their Decoders.") public open override /*1*/ /*fake_override*/ fun patch(/*0*/ decoder: kotlinx.serialization.encoding.Decoder, /*1*/ old: Basic): Basic
|
||||
public open override /*1*/ /*synthesized*/ fun serialize(/*0*/ encoder: kotlinx.serialization.encoding.Encoder, /*1*/ value: Basic): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun typeParametersSerializers(): kotlin.Array<kotlinx.serialization.KSerializer<*>>
|
||||
@@ -45,7 +44,6 @@ package
|
||||
public open override /*1*/ /*synthesized*/ fun deserialize(/*0*/ decoder: kotlinx.serialization.encoding.Decoder): Inside
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
@kotlin.Deprecated(level = DeprecationLevel.ERROR, message = "Patch function is deprecated for removal since this functionality is no longer supported by serializer.Some formats may provide implementation-specific patching in their Decoders.") public open override /*1*/ /*fake_override*/ fun patch(/*0*/ decoder: kotlinx.serialization.encoding.Decoder, /*1*/ old: Inside): Inside
|
||||
public open override /*1*/ /*synthesized*/ fun serialize(/*0*/ encoder: kotlinx.serialization.encoding.Encoder, /*1*/ value: Inside): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun typeParametersSerializers(): kotlin.Array<kotlinx.serialization.KSerializer<*>>
|
||||
@@ -82,7 +80,6 @@ public final class NonSerializable {
|
||||
public open override /*1*/ /*synthesized*/ fun deserialize(/*0*/ decoder: kotlinx.serialization.encoding.Decoder): WithImplicitType
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
@kotlin.Deprecated(level = DeprecationLevel.ERROR, message = "Patch function is deprecated for removal since this functionality is no longer supported by serializer.Some formats may provide implementation-specific patching in their Decoders.") public open override /*1*/ /*fake_override*/ fun patch(/*0*/ decoder: kotlinx.serialization.encoding.Decoder, /*1*/ old: WithImplicitType): WithImplicitType
|
||||
public open override /*1*/ /*synthesized*/ fun serialize(/*0*/ encoder: kotlinx.serialization.encoding.Encoder, /*1*/ value: WithImplicitType): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun typeParametersSerializers(): kotlin.Array<kotlinx.serialization.KSerializer<*>>
|
||||
|
||||
-2
@@ -15,7 +15,6 @@ package
|
||||
public open override /*1*/ /*synthesized*/ fun deserialize(/*0*/ decoder: kotlinx.serialization.encoding.Decoder): Foo
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
@kotlin.Deprecated(level = DeprecationLevel.ERROR, message = "Patch function is deprecated for removal since this functionality is no longer supported by serializer.Some formats may provide implementation-specific patching in their Decoders.") public open override /*1*/ /*fake_override*/ fun patch(/*0*/ decoder: kotlinx.serialization.encoding.Decoder, /*1*/ old: Foo): Foo
|
||||
public open override /*1*/ /*synthesized*/ fun serialize(/*0*/ encoder: kotlinx.serialization.encoding.Encoder, /*1*/ value: Foo): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun typeParametersSerializers(): kotlin.Array<kotlinx.serialization.KSerializer<*>>
|
||||
@@ -51,7 +50,6 @@ public final class NopeNullableSerializer : kotlinx.serialization.KSerializer<No
|
||||
public open override /*1*/ fun deserialize(/*0*/ decoder: kotlinx.serialization.encoding.Decoder): Nope?
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
@kotlin.Deprecated(level = DeprecationLevel.ERROR, message = "Patch function is deprecated for removal since this functionality is no longer supported by serializer.Some formats may provide implementation-specific patching in their Decoders.") public open override /*1*/ /*fake_override*/ fun patch(/*0*/ decoder: kotlinx.serialization.encoding.Decoder, /*1*/ old: Nope?): Nope?
|
||||
public open override /*1*/ fun serialize(/*0*/ encoder: kotlinx.serialization.encoding.Encoder, /*1*/ value: Nope?): kotlin.Nothing
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
-1
@@ -15,7 +15,6 @@ package
|
||||
public open override /*1*/ /*synthesized*/ fun deserialize(/*0*/ decoder: kotlinx.serialization.encoding.Decoder): Test
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
@kotlin.Deprecated(level = DeprecationLevel.ERROR, message = "Patch function is deprecated for removal since this functionality is no longer supported by serializer.Some formats may provide implementation-specific patching in their Decoders.") public open override /*1*/ /*fake_override*/ fun patch(/*0*/ decoder: kotlinx.serialization.encoding.Decoder, /*1*/ old: Test): Test
|
||||
public open override /*1*/ /*synthesized*/ fun serialize(/*0*/ encoder: kotlinx.serialization.encoding.Encoder, /*1*/ value: Test): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun typeParametersSerializers(): kotlin.Array<kotlinx.serialization.KSerializer<*>>
|
||||
|
||||
-3
@@ -6,7 +6,6 @@ public object EnumSerializer : kotlinx.serialization.KSerializer<ExplicitlyMarke
|
||||
public open override /*1*/ fun deserialize(/*0*/ decoder: kotlinx.serialization.encoding.Decoder): ExplicitlyMarkedEnumCustom
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
@kotlin.Deprecated(level = DeprecationLevel.ERROR, message = "Patch function is deprecated for removal since this functionality is no longer supported by serializer.Some formats may provide implementation-specific patching in their Decoders.") public open override /*1*/ /*fake_override*/ fun patch(/*0*/ decoder: kotlinx.serialization.encoding.Decoder, /*1*/ old: ExplicitlyMarkedEnumCustom): ExplicitlyMarkedEnumCustom
|
||||
public open override /*1*/ fun serialize(/*0*/ encoder: kotlinx.serialization.encoding.Encoder, /*1*/ value: ExplicitlyMarkedEnumCustom): kotlin.Nothing
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
@@ -32,7 +31,6 @@ public object EnumSerializer : kotlinx.serialization.KSerializer<ExplicitlyMarke
|
||||
public open override /*1*/ /*synthesized*/ fun deserialize(/*0*/ decoder: kotlinx.serialization.encoding.Decoder): EnumUsage
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
@kotlin.Deprecated(level = DeprecationLevel.ERROR, message = "Patch function is deprecated for removal since this functionality is no longer supported by serializer.Some formats may provide implementation-specific patching in their Decoders.") public open override /*1*/ /*fake_override*/ fun patch(/*0*/ decoder: kotlinx.serialization.encoding.Decoder, /*1*/ old: EnumUsage): EnumUsage
|
||||
public open override /*1*/ /*synthesized*/ fun serialize(/*0*/ encoder: kotlinx.serialization.encoding.Encoder, /*1*/ value: EnumUsage): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun typeParametersSerializers(): kotlin.Array<kotlinx.serialization.KSerializer<*>>
|
||||
@@ -70,7 +68,6 @@ public object EnumSerializer : kotlinx.serialization.KSerializer<ExplicitlyMarke
|
||||
public open override /*1*/ /*synthesized*/ fun deserialize(/*0*/ decoder: kotlinx.serialization.encoding.Decoder): ExplicitlyMarkedEnum
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
@kotlin.Deprecated(level = DeprecationLevel.ERROR, message = "Patch function is deprecated for removal since this functionality is no longer supported by serializer.Some formats may provide implementation-specific patching in their Decoders.") public open override /*1*/ /*fake_override*/ fun patch(/*0*/ decoder: kotlinx.serialization.encoding.Decoder, /*1*/ old: ExplicitlyMarkedEnum): ExplicitlyMarkedEnum
|
||||
public open override /*1*/ /*synthesized*/ fun serialize(/*0*/ encoder: kotlinx.serialization.encoding.Encoder, /*1*/ value: ExplicitlyMarkedEnum): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun typeParametersSerializers(): kotlin.Array<kotlinx.serialization.KSerializer<*>>
|
||||
|
||||
+2
-1
@@ -1,3 +1,4 @@
|
||||
// !DIAGNOSTICS: -EXPERIMENTAL_API_USAGE
|
||||
// WITH_RUNTIME
|
||||
// SKIP_TXT
|
||||
|
||||
@@ -15,4 +16,4 @@ object BazSerializer: KSerializer<Baz>
|
||||
class Foo1(@Polymorphic val i: Baz)
|
||||
|
||||
@Serializable
|
||||
class Foo2(val li: MutableList<@Serializable(with = BazSerializer::class) Baz>)
|
||||
class Foo2(val li: MutableList<@Serializable(with = BazSerializer::class) Baz>)
|
||||
|
||||
+2
-1
@@ -1,3 +1,4 @@
|
||||
// !DIAGNOSTICS: -EXPERIMENTAL_API_USAGE
|
||||
// WITH_RUNTIME
|
||||
// SKIP_TXT
|
||||
|
||||
@@ -32,4 +33,4 @@ class Foo5(@Serializable(with = BazSerializer::class) val i: <!SERIALIZER_TYPE_I
|
||||
class Foo6(@Serializable(with = NullableBazSerializer::class) val i: <!SERIALIZER_NULLABILITY_INCOMPATIBLE, SERIALIZER_TYPE_INCOMPATIBLE!>Bar<!>)
|
||||
|
||||
@Serializable
|
||||
class Foo7(@Serializable(with = NullableBazSerializer::class) val i: <!SERIALIZER_TYPE_INCOMPATIBLE!>Bar?<!>)
|
||||
class Foo7(@Serializable(with = NullableBazSerializer::class) val i: <!SERIALIZER_TYPE_INCOMPATIBLE!>Bar?<!>)
|
||||
|
||||
Vendored
-1
@@ -19,7 +19,6 @@ package
|
||||
public open override /*1*/ /*synthesized*/ fun deserialize(/*0*/ decoder: kotlinx.serialization.encoding.Decoder): WithTransients
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
@kotlin.Deprecated(level = DeprecationLevel.ERROR, message = "Patch function is deprecated for removal since this functionality is no longer supported by serializer.Some formats may provide implementation-specific patching in their Decoders.") public open override /*1*/ /*fake_override*/ fun patch(/*0*/ decoder: kotlinx.serialization.encoding.Decoder, /*1*/ old: WithTransients): WithTransients
|
||||
public open override /*1*/ /*synthesized*/ fun serialize(/*0*/ encoder: kotlinx.serialization.encoding.Encoder, /*1*/ value: WithTransients): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun typeParametersSerializers(): kotlin.Array<kotlinx.serialization.KSerializer<*>>
|
||||
|
||||
Reference in New Issue
Block a user