Skip to content

Release 2.8.6

Latest

Choose a tag to compare

@reid-spencer reid-spencer released this 23 Nov 22:33
· 1 commit to main since this release

What's New

Features

  • New Advisory value-optional-operand. It reports an optional operand
    (T?) of an ordering comparison (<, <=, >, >=) or of arithmetic
    (+, -, *, /). Its first suggested fix is otherwise. The
    Computational Model now gives such an expression no value when the operand
    is absent, so a generator must refuse rather than substitute one: not
    false, not unknown, not zero.
    • Silenced by: otherwise, a when or require guard, or a
      short-circuiting x != empty and … or x == empty or ….
    • Equality is not affected: x == empty is the presence test, and an
      absent value equals only empty.
  • and and or short-circuit, as a must-preserve. The right operand is
    evaluated only when the left has not decided the result, left to right.
    Validation now applies this inside a condition: in x != empty and x <= t,
    the guard covers x.

Bug Fixes

  • A guard now covers a path through the value it guards (BACKLOG [1.34]).
    • What was wrong: after let line = one of … where … and
      when line == empty then error else …, a use of line.unitCost was
      still treated as optional. It drew value-optional-for-required and the
      new advisory.
    • Now: a path through a guarded let or foreach element is optional
      only if a segment after the guarded part is optional.
    • A guard on a longer path also counts: a guard on line.quantity
      proves line present.
    • Still not covered: paths anchored in entity state.

Internal

  • Census: across 191 riddl-models entry points, value-optional-operand
    reports 2 sites, both genuine, at reactive-bbq InventoryItem.riddl :555
    and :567. No other rule moved. Without the [1.34] fix it would also have
    reported two false positives.
  • Formats: there is no grammar, BAST or JSON change. FORMAT_REVISION
    stays at 39.