Skip to main content

validate_type_specifications

Function validate_type_specifications 

Source
pub fn validate_type_specifications(
    specs: &TypeSpecification,
    declared_default: Option<&ValueKind>,
    type_name: &str,
    source: &Source,
    spec_context: Option<Arc<LemmaSpec>>,
) -> Vec<Error>
Expand description

Validate that TypeSpecification constraints are internally consistent.

Checks range, decimals/precision, length, unit, and option constraints, and validates the declared_default (when present) against those constraints. The default lives outside the type specification (on the data binding or typedef entry); callers thread it in explicitly so this function can verify consistency without owning the value.

Returns a vector of errors (empty if valid).