If I wanted to "unwrap" a value class would I just...
# ksp
e
If I wanted to "unwrap" a value class would I just look at the type of the first constructor property?
j
Well the constructor and/or property could be private. Also with the prospect of multi-property value classes on the horizon I would make sure you fail spectacularly in the presence of more than one.
I'd also look into how you handle when the value class is boxed, such as for the upcoming feature to expose them to Java
Long way of saying: no. There's many shapes of value classes that you cannot simply unwrap.
e
I guess I could make it a requirement that there is a single public property and fail otherwise. This use case is mostly for ids, and those classes tend to be pretty straightforward