Describe the bug
serializer(KType) and serializerOrNull(KType) find types annotated with @Serializable but not types annotated with @Serializable(with = …)
To Reproduce
Playground link: https://pl.kotl.in/GPVEn019Z
Expected behavior
The behavior of serializer(KType) should be identical for any class annotated with @Serializable, whether or not it uses with =.
Environment
- Kotlin version: 2.2.21
- Library version: 1.9.0
- Kotlin platforms:
- All non-JVM platforms
- In my own project, this bug doesn't display itself on the JVM. However, the minimal reproducer I linked above on the Kotlin Playground does exhibit the bug, so I'm not sure what's going on.
- Gradle version: 9.2, but I don't think it matters