Kotlin / kotlinx-datetime

KotlinX multiplatform date/time library
Apache License 2.0
2.39k stars 99 forks source link

No longer make Month and DayOfWeek type aliases on the JVM #378

Open dkhalanskyjb opened 6 months ago

dkhalanskyjb commented 6 months ago

Fixes #96

dkhalanskyjb commented 5 months ago

I actually don't remember us discussing this change. We mentioned this issue recently while discussing UUIDs and whether to make them type aliases on the JVM.

If you have doubts about this change, we can hold a meeting. What led me to go and implement this is that expect enums in common code are still non-exhaustive, which I think looks extremely strange.

ilya-g commented 5 months ago

Yes, there are some arguments for this change, like exhaustiveness of matching over expected enum entries and being able to provide companion for static extensions (though these shortcomings will be eventually fixed in Kotlin). On the other hand, this is a binary breaking change.