-
Notifications
You must be signed in to change notification settings - Fork 670
Open
Description
Describe the bug
The documentation states that SerialDescriptor.getElementIndex returns the index or UNKNOWN_NAME when there is no such element. But the map like descriptor will throw if you pass a non integer like descriptor.
To Reproduce
val serializer = MapSerializer(String.serializer(), String.serializer())
val descriptor = serializer.descriptor
descriptor.getElementIndex("key") // ThrowsExpected behavior
There is no documentation that this function will ever throw and it would be more suitable if it returned UNKNOWN_NAME.
Environment
- Kotlin version: 2.3.10
- Library version: 1.10.0
- Kotlin platforms: JVM
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels