You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
java.util.NoSuchElementException is raised when decodeFromJsonElement with nullable type is called
To Reproduce
@Serializable
data classA(vala:Int)
@Test
funtest() {
val a =A(42)
val json =Json.encodeToString(a)
val jsonElement =Json.parseToJsonElement(json)
print(Json.decodeFromString<A?>(json)) // A(a=42)print(Json.decodeFromJsonElement<A?>(jsonElement)) // java.util.NoSuchElementException
}
Expected behavior
Successful decode
Environment
Kotlin version: 1.4.0
Library version: 1.0.0-RC
Kotlin platforms: JVM
Gradle version: 6.3
The text was updated successfully, but these errors were encountered:
Describe the bug
java.util.NoSuchElementException is raised when decodeFromJsonElement with nullable type is called
To Reproduce
Expected behavior
Successful decode
Environment
The text was updated successfully, but these errors were encountered: