3 ms·
I recommend against that, and use proper (wrapper) types. I don't know Kotlin, but in most languages if you alias 2 types to the same base type, for example Se
by dtech 5y ago
I recommend against that, and use proper (wrapper) types.
I don't know Kotlin, but in most languages if you alias 2 types to the same base type, for example Seconds and Minutes to Long, the compiler will happily allow you to mix all 3 of them, defeating the protection full types would bring.
- stefs 5y agothat's correct. typealiases are the wrong solution here. the better solution would be value classes, but of course, the unit shouldn't be the type.