Marcin Wisniowski11/23/2021, 11:35 PM
Stephan Schroeder11/24/2021, 8:03 AM
should only box
@JvmInline value class T(val value: Whatever)
in rare cases like having a
. My guess is that you're hitting one of those cases where boxing has always happened. If you think something is off, please provide us with a codesnipped where T is boxed, and we can check if boxing is to be expected or not. https://typealias.com/guides/inline-classes-and-autoboxing/ (current value classes used to be called inline classes, so this article should still apply)
Stephan Schroeder11/29/2021, 7:42 AM
implement different interfaces that this couldn't be replicated with extension functions 🤔 Do you just wonder out of curiousity, or do you have a usecase in mind?
Marcin Wisniowski11/29/2021, 12:23 PM
value class which packs the two floats into a Long as part of Compose UI. I need a similar
Offset(x: Float, y: Float)
class, with different methods, but the same underlying behavior. So I need a different name and a different set of methods for an existing value class. I could of course just copy the source code of
into my project, but I'd like to avoid that.