Enhancement
Detail
#24756
Typed configuration: no error when accessing mandatory properties that are not set
Accessing an unset property in a config item always fails with an exception. This leads to lots of Quirks code of the type
value = ref.isMandatory() ? (config.valueSet(ref) ? config.value(ref) : null) : config.value(ref);
As long as you work generically with a config item you can still write this. But as soon as you want to use the typed API it gets really ugly - check valueSet via descriptor, property descriptor and property name to get the value via the typed API in a different way.
Improvement
Accessing a programmatically created config item that is not fully initialized returns the type-intrinsic default value for the property's type. This default value may then violate constraints of the property (e.g. non-nullable), but this applies to all other constraints as well.
Test
- test.com.top_logic.basic.config.TestReset.testUnsetMandatoryProperty()