Re:The Road to Valhalla
by cobbzilla on Friday December 06, 2019 @09:21PM
(#21728030)
Reading the doc, I believe this is supported with these restrictions: (1) value classes may only contain other value classes, and (2) value classes cannot contain instances of themselves (no circularity).
[ Parent
| on HN ]
Your first point is incorrect, inline classes can have fields that are regular reference types.
Interesting; I must have “over-read” the restriction. You are correct.
Re-reading the doc, the restriction is that all fields of a value type must be final, because value objects do not have identity.