Leon Linhart
03/09/2020, 2:30 PMEnum class 'TimeUnit' has several compatible actual declarations in modules [...]
. Apparently this is caused by an (artificial?) restriction that only allows a type to serve as actual typealias
once. Now I'm curious if this is a deliberate design decision.
Unfortunately, in this case it becomes impossible to use my own TimeUnit
implementation instead of DurationUnit
(which is still experimental). Additionally, such a change (addition of an actual type alias) seems to be source incompatible and most library authors are probably not aware of this.russhwolf
03/09/2020, 4:56 PMactual typealias
limitation FYI. I don't think it's a deliberate design decision since it only applies for expect/actual, not general typealiases
https://youtrack.jetbrains.com/issue/KT-29341Leon Linhart
03/09/2020, 6:03 PMexpect enum TimeUnit
in my common code and a typealias (actual typealias TimeUnit = java.util.concurrent.TimeUnit
) in my JVM code. When I update to Kotlin >= 1.3.50 (where the Duration API was added), my code does not compile. Seemingly that is due to the addition of actual typealias DurationUnit = java.util.concurrent.TimeUnit
in the Kotlin stdlib.
I'll have another look at this later and open a ticket for it if appropriate.russhwolf
03/09/2020, 6:05 PMLeon Linhart
03/09/2020, 6:06 PMLeon Linhart
03/09/2020, 6:35 PM