Concrete
Rulescontract

concrete/contract/interpolation

A fill brief refers to its facts through reads and never interpolates one.

A fill brief refers to its facts through reads and never interpolates one.

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 fill's model call is shown exactly the refs its reads names, beside its brief — nothing else. Nothing expands a ${facts.…} placeholder in the prose any more, so a brief carrying one is asking for a fact through a second, stringly-typed channel: invisible to the type a reads ref carries, and not a declaration of what the call sees.

The rule covers a fill's brief and its none, each object field's, and a display entry's brief. Any ${facts. in them fails, whatever path follows — a reference to a fact that exists is refused exactly as a misspelled one is, because the reference itself is the defect.

Check-caught. The prose is a string, so nothing about a placeholder is visible to a type — which is why a reads ref, which is typed, is the channel onto a fact.

Fix

Declare the fact in the fill's reads and refer to it by name in the brief.

Before and after

import { fill, text } from "@homepages/concrete";

text.long({
  label: "Neighbourhood",
  cap: 600,
  source: fill.write({ brief: "Open with the neighbourhood: ${facts.address.city}. One plain paragraph." }),
});
import { fact, fill, text } from "@homepages/concrete";

text.long({
  label: "Neighbourhood",
  cap: 600,
  source: fill.write({
    reads: [fact.property.address.city, fact.property.description],
    brief: "Open with the neighbourhood the property's city names. One plain paragraph.",
  }),
});

On this page