# OpaqueType::type-mismatch


**Key:** `OpaqueType::type-mismatch`

**Category:** type-mismatch · **Severity:** error

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

the opaque lambda's declared domain does not match the expected domain

## Example

`Hint::OpaqueType::type-mismatch` means the `OpaqueType` 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 opaque lambda domain disagrees with the expected domain.
opaqueLam (pi bool (_: nat)) body

# Better: align the declared domain with the expected Pi domain.
opaqueLam (pi nat (_: nat)) body

```


---

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