---
title: "U2025: A type argument does not satisfy the constraint of its parameter"
url: https://una-lang.org/en/docs/errors/U2025/
release: v0.4.0
source: https://github.com/una-lang/una/blob/v0.4.0/crates/una-explain/explain/U2025.md
---

# U2025: A type argument does not satisfy the constraint of its parameter

A type argument does not satisfy the constraint of its type parameter.

## Why Una rejects it

A type parameter written with a constraint, as `T: Ord`, can only be instantiated with a type that satisfies it (`spec/20 §1`, `§3` rule 3).

- `Eq` takes every type whose values hold no functions.
- `Ord` takes `Int`, the fixed-width integer types, `Text` and sums whose variants have no payload.
- `Integer` takes `Int` and the fixed-width integer types.

A type parameter of the caller satisfies the constraint written on it, so a generic caller writes the constraint its callees need.

## How to fix it

- Pass a value of a type that satisfies the constraint.
- Or compare by a field that does.

## The repair at a glance

`src/demo.una`

```diff
  module demo

  pub kind Box
    size: Int

- pub largest(a: Box, b: Box) -> Box = max(a, b: b)
+ pub largest(a: Box, b: Box) -> Int = max(a.size, b: b.size)
```

## Failing example

`una.toml`

```toml
[package]
name = "demo"
version = "0.1.0"
edition = "0.2"
```

`src/demo.una`

```una
module demo

pub kind Box
  size: Int

pub largest(a: Box, b: Box) -> Box = max(a, b: b)
```

## Fixed example

`una.toml`

```toml
[package]
name = "demo"
version = "0.1.0"
edition = "0.2"
```

`src/demo.una`

```una
module demo

pub kind Box
  size: Int

pub largest(a: Box, b: Box) -> Int = max(a.size, b: b.size)
```
