Dico
02/19/2019, 5:02 PMactual inline class
to define expect class
in the future?
This to me seems like a prime use case of inline classes, as type aliases are not an option if there are tiny differences between the expected and actual type.
I previously assumed that this is already possible, but it isn't, and I don't see a reason why it shouldn't be other than a bit of implementation complexity.russhwolf
02/19/2019, 5:20 PMexpect inline class
?Dico
02/19/2019, 5:26 PMexpect
declaration requires a primary constructor with a property parameter.
expect inline class Hello(val string: String)
actual inline class Hello(val del: Any) {
actual constructor(string: String) : this(string as Any)
actual val string: String get() = del.toString()
}
fun main() {
val hello = Hello("5000")
println(hello.string)
}
expect class
though I think.