Kotlin, Android, Software Development, Kotlin Multiplatform, Java.
Kilometer { return (miles * 1.6f).toInt() } // allowed to pass Kilometer (or any Int) as Mile val miles: Mile = 1 val kilometers: Kilometer = 5 convertMileToKilometer(miles = kilometers) // OK convertMileToKilometer(miles = 10) // OK For a more strongly typed solution, we can use inline value