-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't typealias Month (and others) #96
Comments
Another example for Android
|
@september669 the whole library requires coreLibraryDesugaring to be enabled enabling the use of java.time on previous API levels. |
Thanks a lot! |
I actually like the typealiasing as when we further process the data in the android project, we'd need need to create a wrapper that does the mapping. The argument with the factories will go away when the namespace feature arrives. |
I suggest to not typealias anything in a multiplatform date/time library.
For example:
I had code in the back-end that used
Month.of(someInt)
. The code was relatively simple and there were no JVM-specific imports. So I've moved it to a shared multiplatform dependency and was surprised thatMonth.of()
was no longer available.Month.<autocomplete>
didn't provide me with any useful alternative.After Cmd-clicking on
Month
I've learned that it is merely a typealias on JVM. It took a while to figure out that there's an additionalMonth(Int)
function in kotlinx-datetime that I should've used instead. Scenarios like that can easily lead to confusion and inconsistency.The text was updated successfully, but these errors were encountered: