TS2637
error TS2637: Variance annotations are only supported in type aliases for object, function, constructor, and mapped types.
Broken Code ❌
1 |
|
Fixed Code ✔️
Variance annotations only make sense if variance is considered while resolving the type alias. Since tuples and arrays are always type-checked covariantly, they do nothing in this case and thus raise the error.
To resolve the error, simply remove the variance annotation.
1 |
|