kotlinx.serialization icon indicating copy to clipboard operation
kotlinx.serialization copied to clipboard

Different serialization error depending on platform for Interface / sealed interface inheritance

Open Reedyuk opened this issue 3 years ago • 0 comments

When a serializable data class inherits an interface or a sealed interface and we cast to the interface first then we get different results per platform.

To Reproduce Attach a code snippet or test data if possible.

Expected behavior Interfaces shouldnt need @serializable notation, sealed classes should have it but the platform should treat it the same as an interface.

Environment

  • Kotlin version: 1.6.21, 1.7.0
  • Library version: 1.3.0, 1.3.3
  • Kotlin platforms: Native, Android and JS
  • Gradle version: 7.4.1

Please checkout the repository and run the unit tests, you will see all tests pass on JS, one test fails on iOS and the same test passes on android but the other test fails.

Reedyuk avatar Jun 29 '22 08:06 Reedyuk