# TSR0801: Definite assignment assertion on '…' is not allowed in sound mode. Initialise it in its declaration or the constructor.

> A definite assignment assertion ('field!: T' or 'let x!: T') is used in a sound file. Initialise the value or make its type include undefined.

## What it means

`field!: T` and `let x!: T` tell the checker a value is assigned before use without proving it. Sound files don't allow them (nor `declare` field redeclarations whose type differs from the inherited one). It's reported at the `!`.

## Example

```ts
// A local asserted to be assigned before use.
let count!: number; // @expect TSR0801
function init(): void {
  count = 1;
}
init();
export const c: number = count;
```

## How to fix

- Initialise the field in its declaration or assign it in the constructor.
- Or make the type `T | undefined` and handle the missing case.
- Fields set from outside by a framework (dependency injection, decorators) need a `// @ts-r-unsafe S-08: <reason>` hatch per field, or the file kept at `strict`.

Sound mode is defined in [design record 0007](https://github.com/Webb-Ventures/typescript-rust/blob/main/docs/design/0007-sound-mode.md) (accepted 2026-10-15).

Source: https://ts-r.dev/errors/TSR0801/
