# no-redundant-type-constraint

Disallow generic constraints equal to the implicit top type

An `unknown` generic constraint accepts the same arguments as an unconstrained type parameter.
Instead, you SHOULD omit the redundant constraint.

- Category: style
- Level: warning
- Fix: automatic
- Scope: module

## Reported

```ds title="main.ds"
function identity<T: unknown>(value: T): T {
    return value;
}
```

## Accepted

```ds title="main.ds"
function identity<T>(value: T): T {
    return value;
}
```

## Prior art

- [typescript-eslint · no-unnecessary-type-constraint](https://typescript-eslint.io/rules/no-unnecessary-type-constraint)

[language/linter/src/rules/style/no_redundant_type_constraint.rs:7](https://github.com/destack-sh/destack/blob/main/language/linter/src/rules/style/no_redundant_type_constraint.rs#L7)
