kopykat-kt / kopykat

Little utilities for more pleasant immutable data in Kotlin
Other
283 stars 16 forks source link

Keep nullability information in 'mutationInfo' #63

Closed serras closed 2 years ago

serras commented 2 years ago

Fixes #62

As @maxschlosser correctly identified in https://github.com/kopykat-kt/kopykat/issues/62#issuecomment-1276478384, the issue comes from not preserving nullability information when generating the "mutation info", that is, the mapping of properties that go into the Class$Mutable type generated as part of "mutable copy". It turns out that KSP's KSType.toClassName was not respecting this information, so the solution has been to hack own on toClassNameRespectingNullability.