Kotlin, Android, Software Development, Kotlin Multiplatform, Java.
not allowed to pass Kilometer as Mile val miles = Mile(1) val kilometers = Kilometer(5) convertMileToKilometer(miles = kilometers) // error convertMileToKilometer(miles = 10) // error convertMileToKilometer(miles = miles) // OK Value classes can also contain other functions and simple properties,