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

`@KeepGeneratedSerializer ` cannot be used with `typealias`

Open sschuberth opened this issue 1 year ago • 0 comments

Describe the bug

When I have

internal typealias DependencyMap = @Serializable(DependencyMapSerializer::class) Map<String, Dependency>

I'd expect to be able to do

internal typealias DependencyMap = @Serializable(DependencyMapSerializer::class) @KeepGeneratedSerializer Map<String, Dependency>

but that does not compile, saying WRONG_ANNOTATION_TARGET.

Environment

  • Kotlin version: 2.0.21
  • Library version: 1.7.3
  • Kotlin platforms: JVM
  • Gradle version: 8.10.2

sschuberth avatar Oct 15 '24 17:10 sschuberth