Skip to content

Commit 3b844be

Browse files
authored
Remove some @Suppress that are no longer necessary (#2796)
and last instances of @Suppress(INVISIBLE_REFERENCE) in production code.
1 parent d4d066d commit 3b844be

File tree

8 files changed

+3
-14
lines changed

8 files changed

+3
-14
lines changed

core/commonMain/src/kotlinx/serialization/builtins/BuiltinSerializers.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ public fun Char.Companion.serializer(): KSerializer<Char> = CharSerializer
6161
* Returns serializer for [CharArray] with [descriptor][SerialDescriptor] of [StructureKind.LIST] kind.
6262
* Each element of the array is serialized one by one with [Char.Companion.serializer].
6363
*/
64-
@Suppress("UNCHECKED_CAST")
6564
public fun CharArraySerializer(): KSerializer<CharArray> = CharArraySerializer
6665

6766
/**

core/commonTest/src/kotlinx/serialization/BasicTypesSerializationTest.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ class BasicTypesSerializationTest {
198198
// impossible to deserialize Nothing
199199
assertFailsWith(SerializationException::class, "'kotlin.Nothing' does not have instances") {
200200
val inp = KeyValueInput(Parser(StringReader("42")))
201-
@Suppress("IMPLICIT_NOTHING_TYPE_ARGUMENT_IN_RETURN_POSITION")
202201
inp.decodeSerializableValue(NothingSerializer())
203202
}
204203

formats/json-tests/commonTest/src/kotlinx/serialization/features/inline/InlineClassesCompleteTest.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/*
22
* Copyright 2017-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
33
*/
4-
@file:Suppress("INLINE_CLASSES_NOT_SUPPORTED", "SERIALIZER_NOT_FOUND")
5-
64
package kotlinx.serialization.features.inline
75

86
import kotlinx.serialization.*

formats/json-tests/commonTest/src/kotlinx/serialization/features/inline/InlineClassesTest.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
* Copyright 2017-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

5-
@file:Suppress("INLINE_CLASSES_NOT_SUPPORTED", "SERIALIZER_NOT_FOUND")
6-
75
package kotlinx.serialization.features.inline
86

97
import kotlinx.serialization.*

formats/json-tests/commonTest/src/kotlinx/serialization/test/TestHelpers.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
* Copyright 2017-2022 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

5-
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
6-
75
package kotlinx.serialization.test
86

97
import kotlinx.serialization.*

formats/json-tests/jvmTest/src/kotlinx/serialization/features/JsonJvmStreamsTest.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@
22
* Copyright 2017-2022 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

5-
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
6-
75
package kotlinx.serialization.features
86

97
import kotlinx.serialization.*
108
import kotlinx.serialization.builtins.serializer
119
import kotlinx.serialization.json.*
12-
import kotlinx.serialization.json.internal.BATCH_SIZE
1310
import kotlinx.serialization.modules.*
1411
import kotlinx.serialization.test.*
1512
import org.junit.Test
@@ -19,6 +16,7 @@ import kotlin.test.assertEquals
1916
import kotlin.test.assertFailsWith
2017

2118
class JsonJvmStreamsTest {
19+
val BATCH_SIZE = 16 * 1024 // kotlinx.serialization.json.internal.BATCH_SIZE
2220
private val strLen = BATCH_SIZE * 2 + 42
2321

2422
@Test

formats/json/commonMain/src/kotlinx/serialization/json/internal/StringOps.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ private fun toHexChar(i: Int) : Char {
1212
else (d - 10 + 'a'.code).toChar()
1313
}
1414

15-
@PublishedApi
16-
internal val ESCAPE_STRINGS: Array<String?> = arrayOfNulls<String>(93).apply {
15+
@JsonFriendModuleApi
16+
public val ESCAPE_STRINGS: Array<String?> = arrayOfNulls<String>(93).apply {
1717
for (c in 0..0x1f) {
1818
val c1 = toHexChar(c shr 12)
1919
val c2 = toHexChar(c shr 8)

formats/json/commonMain/src/kotlinx/serialization/json/internal/TreeJsonDecoder.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ private open class JsonTreeDecoder(
203203
{ (currentElement(tag) as? JsonPrimitive)?.contentOrNull }
204204
)
205205

206-
@Suppress("INVISIBLE_MEMBER")
207206
override fun decodeElementIndex(descriptor: SerialDescriptor): Int {
208207
while (position < descriptor.elementsCount) {
209208
val name = descriptor.getTag(position++)

0 commit comments

Comments
 (0)