WIP: Don't typealias Month#174
Conversation
|
@dkhalanskyjb Closing this PR. Is it even worth discussing in a separate issue? This could be a general architectural discussion and the Month typealias is just one aspect of the way expect/actual is used. |
|
There's an issue for it already: #96 |
|
Not quite. That only focuses on the Month typealias. My suggestion is to generally apply the rule: avoid |
|
The library is fairly compact, so its internal architecture can be changed on a whim once we need it and does not matter much. What matters is the API that we provide to the programmers, and they typically shouldn't care whether something is
|
I don't think there's any similarly fatal issue. The other issue is that this whole library can't use |
This is just one example from the codebase. Why are so many APIs
expectand why do we even try to usetypealiasat all? This makes it more difficult to define a nice API for Kotlin and it causes lots of code repetition. It's even impossible to usesealed interface/classwithexpect/actualbecause the multiplatform code lives in different modules (see #173, #177 and #175 for how this can be useful).I think it would be much better to separate the
expectAPIs and make theminternaland expose a nice and clear non-expect basedpublicAPI (which can call theinternal expectAPI inside).What do you think?