# Tag::refinement-failed


**Key:** `Tag::refinement-failed`

**Category:** refinement · **Severity:** error

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

the variant's payload violates the branch type's refinement predicate

## Example

`Hint::Tag::refinement-failed` means the `Tag` position contains a value that fails the refinement predicate. The example shows the failing form first, then one way to give the checker the missing structure.

```nix
# Bad: the variant payload fails the branch refinement.
Port.validate { tag = "Tcp"; value = -1; }

# Better: the payload satisfies the branch refinement.
Port.validate { tag = "Tcp"; value = 443; }

```


---

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