-
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
error TS2304 for type definitions with generic assignment #7578
Comments
Types do not exist at runtime, they are just design time constructs that help guide the compiler to understand your code. For instance interfaces have no runtime manifestation. |
This is a duplicate of #2552. |
Well, I have to accept that. |
#2559 is probably a closer duplicate |
For:
tsc complains:
I would expect the code to be valid. If it were not valid - for which ever reason - then it should be line 7 which it complains about.
Btw. Seems to make no difference, whether i assign T to a literal type like string, or another class.
Of course, as workaround this also works:
However, this generates unnecessary runtime code. (e.g. ES5):
Not sure, whether it would be valid to treat empty subclasses like an alias instead of prototypic inheritance.
Also interesting the free floating semi-colon right at the end.
The text was updated successfully, but these errors were encountered: