Assignment compatibility is directional: type T is assignable to type U when every T value can be assigned as a U value. The reverse relation does not automatically hold. section 13.3
The implementation uses a simpler compatibility rule: types match when their type-object IDs are equal. Assignability also provides a broader way to describe inheritance and type coercion. section 13.3
Type objects support compatibility checks throughout the language implementation:
- Compare type-object IDs instead of relying on JavaScript object equality. section 13.3
- Propagate equality checks into attribute constraints and report mismatched types using readable type names. section 13.3
- Use compatible built-in types to control number rendering, including dollar, day, and percentage markers. section 13.3
Attribute and value compatibility
When an attribute and its value are both typed, the constraint checker compares their type objects. A mismatch produces an issue stating that the types must match and displaying both types. section 13.3
Table 13.1 The type objects for built-in types
|
Type name
|
ID
|
Concept label
|
Settings
|
|---|---|---|---|
amount
|
numberType_amount
|
Number Type
|
{ "unit": "$" }
|
date range
|
numberType_dateRange
|
Interval Type
|
{ "unit": "day" }
|
percentage
|
numberType_percentage
|
Number Type
|
{ "unit": "%" }
|
untype
|
untype_untype
|
Untype
|
{}
|
Built-in type objects make compatibility concrete: amount, date range, percentage, and untype each have a distinct ID and representation. section 13.3


