Closed vladimirfx closed 2 weeks ago
Thanks for the report. Apparently @file:UseContextualSerialization(UUID::class)
or @file:UseContextualSerialization(UUID::class, Date::class)
work as expected but @file:UseContextualSerialization(forClasses = [UUID::class])
does not. That is... not what I expected from compiler plugin API.
Describe the bug
@file:UseContextualSerialization
annotation simply doesn't work starting from Kotlin 2.0.0 up to 2.0.20-RC2. Compilation fails with:Serializer has not been found for type 'java.util.UUID'. To use context serializer as fallback, explicitly annotate type or property with @Contextual
To Reproduce
Reproducer project: use-contextual-serializer-bug.zip
Expected behavior
The code above should compile normally.
Environment