Skip to content

Check for multiple lower/upper bounds fails if type parameter occurs on right side of bound #881

@lars-reimann

Description

@lars-reimann

Describe the bug

The check whether a type parameter has multiple lower or upper bounds does not work if the type parameter occurs on the right side of a bound. However, X sub Y is the same as Y super X.

To Reproduce

Code:

class C<T1, T2> where {
    T1 sub Int,
    T2 super T1 // there should be an error here
}

Expected behavior

An error should be shown for the second bound of the above example.

Screenshots (optional)

No response

Additional Context (optional)

No response

Metadata

Metadata

Assignees

Labels

releasedIncluded in a release

Type

No type

Projects

Status

✔️ Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions