-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: Why can't type parameters be used inside type parameters? #6224
Comments
Thanks for your response @saschanaz. That's the solution I'm using to overcome this at the moment, I'm just wondering if there is perhaps a better one, since to extend that class using a subclass of B I must override the parameter (see class E below). class D<Z> extends B<Z> {
// ...
}
class E<Y> extends C<Y> {
public b: D<Y>;
// ...
} |
Has @saschanaz deleted their comment?
|
@ryansmith94 Ah, I thought my answer was not 100% right so I deleted it, sorry. |
Ah no worries, I wouldn't worry about posting something you're unsure about as long as you say that you're not sure 😄 |
Try installing the nightly of TypeScript ( |
Awesome! Thanks @DanielRosenwasser 👍 |
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?The text was updated successfully, but these errors were encountered: