If I wanted to "unwrap" a value class would I just look at the type of the first constructor property?
j
jw
03/12/2025, 12:25 PM
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.
jw
03/12/2025, 12:26 PM
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
jw
03/12/2025, 12:27 PM
Long way of saying: no. There's many shapes of value classes that you cannot simply unwrap.
e
eygraber
03/12/2025, 1:37 PM
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