Closed
Description
Hey all, hoping to be educated by someone. I think I need to reuse type parameters inside type parameters (see example code below, specifically the reuse of Y
), but this is firstly not allowed by TypeScript (and perhaps other languages too), and secondly it seems "odd". So I'm wondering, why can't type parameters be used inside type parameters? Is there a solution to this I'm missing?
class A {
// ...
}
class B<Z extends A> {
public a: Z;
// ...
}
class C<Y extends A, X extends B<Y>> {
public a: Y;
public b: X;
// ...
}