Is your feature request related to a problem?
The following code should not be legal:
class C<T> {
fun f() where {
T sub Int
}
}
Type parameter constraints must refer to type parameters of the declaration that directly contains the constraint list. The scoping is deliberately more lenient and points to the outer T to provide better error messages.
Desired solution
Add a validation check for this.
Possible alternatives (optional)
No response
Screenshots (optional)
No response
Additional Context (optional)
No response