2 ms·
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 conta
by cobbzilla 7y ago
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).
- efge 7y agoYour first point is incorrect, inline classes can have fields that are regular reference types.
- cobbzilla 7y agoInteresting; 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.