hfhbd
04/10/2021, 9:36 AM2.days or Duration.days(2)
I would bring a pitch solving this design:
val timeToFix: Duration = .days(2)
This design is used in Swift. In Swift, every static function (or enum case) can be called by using a short dot annotation. This is also useful in function parameters
fun something(r: Result<String>) { }
something(.success("Hello")
In Kotlin, there are no static functions, but there is a companion object
. All functions of the companion object could be called using this syntax.ephemient
04/10/2021, 2:56 PMhfhbd
04/10/2021, 3:17 PM