Rule 4.3
Chapter 4, Types Test
A brand must be erased: f32 & { readonly [m]: 'm' } and { readonly __brand: 'm' } are the carrier type, and the brand must reach no emitted text.
The rule text and the parts under it are the compiler's own English, as the design document writes them.
Rationale
the brand exists so that tsc distinguishes two uses of one carrier, and tsc is where that check belongs.
Derives from
surface §28.
How it is verified
Checked by a test. A test, a gate script or a CI workflow names this rule, and the traceability check fails when a file listed below stops naming it.
Where the rule says the compiler enforces it:
examples/tuple-and-brand.shade.ts on both halves of the gate.
The files that verify it at commit 26de7be8, each at the first line that names the rule:
Explained in
The sections of the surface document that explain this rule, at commit 26de7be8:
See also
- Rule 4.2 Test
- Rule 4.4 Test
- Design rules
- Error codes
Source
The rule at commit 26de7be8:
docs/language-design.md:283(the design document)reqs/rules/RULE-0403.md(its traceability item)