---
title: "Rule 12.5: Diagnostics, a TypeShade design rule"
description: "Rule 12.5 of the TypeShade language design, in Diagnostics. The message text is part of the contract…"
url: https://typeshade.dev/reference/rules/12-5/
language: en
---

# Rule 12.5

Chapter 12, Diagnostics Test

The message text is part of the contract: a test that pins a refusal must assert the code and the text, and a change to the text is a change to the surface.

The rule text and the parts under it are the compiler's own English, as the design document writes them.

## Rationale

an issue’s “Expected” row spells the sentence, and the sentence is what the author sees.

## Derives from

the refusal tests under `src/compiler/ts/`, which pin the text, and the “Expected” section of each issue of [#162](https://github.com/typeshade/typeshade/issues/162), which spells it.

## 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:

the refusal tests under `src/compiler/ts/`.

The files that verify it at commit af54ddad5, each at the first line that names the rule:

- [`src/compiler/ts/abstract-super.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/abstract-super.test.ts#L1)
- [`src/compiler/ts/class-member-diagnostics.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/class-member-diagnostics.test.ts#L1)
- [`src/compiler/ts/field-initializer-range.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/field-initializer-range.test.ts#L1)
- [`src/compiler/ts/honest-refusals-tuples.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/honest-refusals-tuples.test.ts#L1)
- [`src/compiler/ts/honest-refusals.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/honest-refusals.test.ts#L1)
- [`src/compiler/ts/io-name-cascades.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/io-name-cascades.test.ts#L1)
- [`src/compiler/ts/local-call-diagnostic-names.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/local-call-diagnostic-names.test.ts#L1)
- [`src/compiler/ts/pow-remedies.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/pow-remedies.test.ts#L1)
- [`src/compiler/ts/switch-validation.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/switch-validation.test.ts#L1)
- [`src/language-service/compiled-output-diagnostics.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/language-service/compiled-output-diagnostics.test.ts#L1)
- [`src/language-service/generic-arity-diagnostics.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/language-service/generic-arity-diagnostics.test.ts#L1)
- [`src/language-service/loop-control-diagnostics.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/language-service/loop-control-diagnostics.test.ts#L1)
- [`src/language-service/module-variable-diagnostics.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/language-service/module-variable-diagnostics.test.ts#L1)

## See also

- [Rule 12.4](https://typeshade.dev/reference/rules/12-4/) Test
- [Rule 12.6](https://typeshade.dev/reference/rules/12-6/) Test
- [Design rules](https://typeshade.dev/reference/rules/)
- [Error codes](https://typeshade.dev/reference/errors/)

## Source

The rule at commit af54ddad5:

- [`docs/language-design.md:1752`](https://github.com/typeshade/typeshade/blob/af54ddad5/docs/language-design.md#L1752) (the design document)
- [`reqs/rules/RULE-1205.md`](https://github.com/typeshade/typeshade/blob/af54ddad5/reqs/rules/RULE-1205.md) (its traceability item)
