Skip to content

Conversation

@sandwwraith
Copy link
Member

  • Value class is located at top-level, but wraps non-primitive and thus does not fall in 'primitive on top-level' branch
  • Value class is a subclass in a polymorphic hierarchy, but either is primitive or explicitly recorded without type info

Note that type info is omitted in the latter case and 'can't add type info to primitive' error is not thrown deliberately, as there seems to be use-cases for that.

Fixes #1774
Fixes #2159

- Value class is located at top-level, but wraps non-primitive and thus does not fall in 'primitive on top-level' branch
- Value class is a subclass in a polymorphic hierarchy, but either is primitive or explicitly recorded without type info

Note that type info is omitted in the latter case and 'can't add type info to primitive' error is not thrown deliberately, as
there seems to be use-cases for that.

Fixes #1774
Fixes #2159
@qwwdfsad qwwdfsad requested review from shanshin and removed request for qwwdfsad and shanshin April 19, 2023 15:37
@sandwwraith sandwwraith merged commit fc9aef5 into dev Apr 20, 2023
@sandwwraith sandwwraith deleted the value-class-encoding-fix branch April 20, 2023 10:18
xBaank pushed a commit to xBaank/kotlinx.serialization that referenced this pull request Apr 20, 2023
- Value class is located at top-level, but wraps non-primitive and thus does not fall in 'primitive on top-level' branch
- Value class is a subclass in a polymorphic hierarchy, but either is primitive or explicitly recorded without type info

Note that type info is omitted in the latter case and 'can't add type info to primitive' error is not thrown deliberately, as
there seems to be use-cases for that.

Fixes Kotlin#1774
Fixes Kotlin#2159
xBaank added a commit to xBaank/kotlinx.serialization that referenced this pull request Apr 20, 2023
xBaank added a commit to xBaank/kotlinx.serialization that referenced this pull request Apr 20, 2023
* Revert "Adapt tests for K2 and upcoming deprecations in K1 (Kotlin#2230)"

This reverts commit f9229ef.

* Revert "Fix value class encoding in various corner cases (Kotlin#2242)"

This reverts commit 3cec2f7.

* Revert "Improved docs for JsonContentPolymorphicSerializer (Kotlin#2189)"

This reverts commit 3555872.

* Revert "Fix incorrect json decoding iterator's .hasNext() behavior on array-wrapped inputs: (Kotlin#2268)"

This reverts commit 2864aea.

* Revert "Fix memory leak caused by invalid KTypeWrapper's equals method (Kotlin#2274)"

This reverts commit 836f2bd.

* Revert "Replace deprecated ThreadLocal with kotlin.native.concurrent.ThreadLocal (Kotlin#2266)"

This reverts commit d73f6e3.

* Revert "Get rid of deprecated toChar() in JS-specific code (Kotlin#2252)"

This reverts commit 3686362.

* Revert "Rename json-okio `target` variables to `sink` (Kotlin#2226)"

This reverts commit a978cf0.

* Revert "Replace `runCatching-map-getOrDefault` in caching (Kotlin#2248)"

This reverts commit da91066.

* Revert "Configure project settings for Intellij IDEA (Kotlin#2217)"

This reverts commit d519d45.

* Revert "Updated K/N targets in accordance with official recommendations (Kotlin#2216)"

This reverts commit fe63ced.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants