https://kotlinlang.org logo
Title
r

robstoll

10/16/2018, 10:43 AM
Will inline classes allow to wrap a pair? would be nice to have named pairs without overhead
a

Andreas Sinz

10/16/2018, 10:43 AM
Pair as in two values or a single Pair instance?
r

robstoll

10/16/2018, 10:44 AM
single
Pair
instance, as far as I know only one value is allowed
b

Burkhard

10/16/2018, 10:44 AM
Yes, you can wrap
Pair
instance
r

robstoll

10/16/2018, 10:44 AM
nice 🙂
b

Burkhard

10/16/2018, 10:44 AM
you can wrap any object you like
a

Andreas Sinz

10/16/2018, 10:45 AM
you can wrap any single property with an inline class
b

Burkhard

10/16/2018, 10:45 AM
The only thing I have not tried is to wrap another inline class
n

Nikky

10/16/2018, 12:02 PM
wrapping a UInt is possible then ? nice.. for different kinds of ids
b

Burkhard

10/16/2018, 1:19 PM
I just tried it out. It seems to work.
k

karelpeeters

10/16/2018, 6:24 PM
Why would you wrap
Pair
? Just do
data class Point(val x: Int, val y: Int)
r

robstoll

10/19/2018, 8:34 PM
@karelpeeters You're right. What was I thinking 😄