Concrete
Rulescontract

concrete/contract/list-fill

A list fill declares what its source needs: a brief wherever the model yields the items, a max wherever it writes rather than picks them, and nothing of the model's on a list bound to a table.

A list fill declares what its source needs: a brief wherever the model yields the items, a max wherever it writes rather than picks them, and nothing of the model's on a list bound to a table.

Graded by the contracts stage of concrete check, in the contract venue. A violation reports this id and the file it failed at — see every rule and concrete check.

Reason

A list fill names its verb — fill.write, fill.pick or fill.find — and what that verb owes, its brief, a pick's candidates, a written list's item and the list's max, is contract/fill-verb's to grade. Two things stay here for every list fill: the model's options sit only where the origination can honour them, and a list sourced by a table is the table's, one item per row, with no brief or none of its own. An address find may come back empty, so it takes none like the lists the model writes; a pick needs none, since its verdict already leaves a list empty when no candidate belongs, and neither does a find of places, which fills empty when none is nearby.

The rest of this rule holds list fills built by a Concrete older than 9.0, which named no verb: where the rows came from was derived from the list's item, and what each origination needed said is graded as it always was:

  • a record list's rows come from one of two places: the table it is bound to, or the model, which writes them field by field — so every row field the list does not bind to a row member or compute() declares its own fill. A row field with no origin leaves the rows with none;
  • a list the model WRITES — text items, or record rows whose every field declares its own fill — needs something to say how many: the fill's count, or the slot's own max. A written list has no candidate supply, so with neither it has no length at all;
  • every list the model originates needs its brief, which is the whole instruction;
  • a count: { min, max } band has its ends in order.

Check-caught for a stored section. Today's builders cannot write any of these: a filled list owes max and a written list its item, by type, and a picked list an item holding its one from, when it is declared; brief is required, and a table-sourced list has no fill to carry a none.

Fix

Rebuild the section with the current Concrete and give the list its verb: a fill.write, the kind it writes declared as the list's item, and a max on the list. A list of objects whose fields the model writes is a written list, its fields each carrying their own fill.

Before and after

// A fill named no verb before 9.0; this half is that stored shape, and today's builders refuse it.
// @noErrors
import { fact, fill, list, text } from "@homepages/concrete";

list({
  label: "Features",
  source: fill({
    reads: [fact.property.description],
    brief: "The features this unit has, each a short noun phrase.",
  }),
  item: text.short({ label: "Feature", cap: 80 }),
});
import { fact, fill, list, text } from "@homepages/concrete";

list({
  label: "Features",
  max: 6,
  source: fill.write({
    reads: [fact.property.description],
    brief: "The features this unit has, each a short noun phrase.",
  }),
  item: text.short({ cap: 80 }),
});

On this page