Skip to content

Validation: Type parameter may only have one upper & one lower bound #867

@lars-reimann

Description

@lars-reimann

Is your feature request related to a problem?

Since we don't allow multiple inheritance or the use of union types in any out-position, we should likewise only allow one upper and one lower bound for type parameters.

Desired solution

Add a check on any subsequent type parameter bounds after the first. Having one upper and one lower bound is OK.

For any computation involving type parameter bounds, only consider the first upper/lower bound.

Possible alternatives (optional)

No response

Screenshots (optional)

No response

Additional Context (optional)

No response

Metadata

Metadata

Assignees

Labels

releasedIncluded in a releasevalidation ✔️Improved or new static checks

Type

No type

Projects

Status

✔️ Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions