# TSR0701: Type predicate '… is …' is not proved: when it returns true, '…' can be '…'.

> A type guard ('x is T') returns true for values that aren't T. Make the checks in its body prove T, or use is<T>().

## What it means

A user-defined type predicate on a function with a body in a sound file must be proved by its body: wherever it returns true, the checker's flow type of the parameter must be assignable to the predicate type. It's reported at the predicate in the signature. Predicates without a body (interfaces, overloads, `.d.ts`) are trusted.

## Example

```ts
// A generic guard that always says yes.
function isPresent<T>(x: T | null): x is T { // @expect TSR0701
  return true;
}
function orEmpty(v: string | null): string {
  return isPresent(v) ? v : "";
}
export const s: string = orEmpty(null);
```

## How to fix

- Check enough in the body that the true side really is `T` (`typeof`, `instanceof`, discriminants).
- Generate the guard from the type: `return is<T>(x)` with `@ts-r.dev/guard`.
- For a guard that checks a few fields of a larger type, validate the whole type instead.

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/TSR0701/
