# DRetIndex::type-mismatch


**Key:** `DRetIndex::type-mismatch`

**Category:** indexing · **Severity:** error

**Source:** [`src/diag/hints.nix:852`](https://github.com/kleisli-io/nix-effects/blob/main/src/diag/hints.nix#L852)

the index position of `ret` must match the Desc's declared index type. Supply a term of that index type, or redefine the enclosing `μ I ...` over the index you actually have.

## Example

`Hint::DRetIndex::type-mismatch` means the `DRetIndex` position supplies a term whose type does not match the expected type. The example shows the failing form first, then one way to give the checker the missing structure.

```nix
# Bad: the return index is not in the Desc index type.
descRet wrongIndex

# Better: return at an index of the declared index type.
descRet expectedIndex

```


---

[← All diagnostic hints](/nix-effects/diag-hints)
