---
title: "Rule 6.4: Declarations and resources in TypeShade"
description: "Rule 6.4 of the TypeShade language design, in Declarations and resources."
url: https://typeshade.dev/reference/rules/6-4/
language: en
---

# Rule 6.4

Chapter 6, Declarations and resources Test

A pipeline-overridable constant must be written `const x: override<T> = default` or `declare const x: override<T>`.

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

## Rationale

WGSL’s `override` has no TypeScript form, so the wrapper is the one place the word appears (§9.3, family 2).

## Derives from

[`override` Declarations](https://gpuweb.github.io/gpuweb/wgsl/#override-decls); surface §15.

## 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/override-constants.test.ts`.

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

- [`examples/override-constants.test.ts:9`](https://github.com/typeshade/typeshade/blob/af54ddad5/examples/override-constants.test.ts#L9)

## Explained in

The sections of the surface document that explain this rule, at commit af54ddad5:

- [§15 Textures, samplers and overrides](https://github.com/typeshade/typeshade/blob/af54ddad5/docs/use-typeshade-surface.md#15-textures-samplers-and-overrides)

## See also

- [Rule 6.3](https://typeshade.dev/reference/rules/6-3/) Test
- [Rule 6.5](https://typeshade.dev/reference/rules/6-5/) 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:512`](https://github.com/typeshade/typeshade/blob/af54ddad5/docs/language-design.md#L512) (the design document)
- [`reqs/rules/RULE-0604.md`](https://github.com/typeshade/typeshade/blob/af54ddad5/reqs/rules/RULE-0604.md) (its traceability item)
