error schema-break
Несовместимое изменение схемы относительно oxl.schema.lock (§9.2, прил. C).
What it means#
The compiler compares the schema of the sources with oxl.schema.lock (and, for oxl check --against <file>, with another lock file). A change that old readers or writers cannot survive is rejected, with the rule of the table in §9.2:
- a field or variant removed without
@removed; - a reused or changed tag;
- a field type changed, other than
i32 -> i64,u32 -> u64,f32 -> f64andT -> T?; - a required field added (no default, not optional);
T?changed toT;- a variant removed, or added to an enum that is not
@open; - the representation (
@repr) or codec (@codec) of a type or field changed.
Raising @v(n) of the type acknowledges a breaking change (D-2107).
Example#
// oxl.schema.lock has Order { id (1), note (2) }
data Order {
id: i64 // <- schema-break: field `note` was removed without @removed
}How to fix#
Keep the field and mark it removed on the type (@removed(2, "note")), make a new field optional or give it a default, widen types only along the allowed extensions; or, for a deliberate breaking change, bump @v and publish a new major version.