-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
TypeError: b is undefined in __extends #4341
Comments
Why isn't this expected behavior?
Generates
The IIFE after I don't know how you could get the above functionality ... maybe:
|
It's expected, it's just that the compiler should warn you that this will happen. |
As mentioned, dupe of #2854 |
@sheetalkamat has a fix for the class issue since it has been biting users quite frequently. |
I'd love to see this fix soon. It's a huge pain when using a code generator. |
I am having the same issue even if the class is used after the other: BaseClass.ts:
ChildClass.ts:
Generates:
It seems that the order is correct, although it doesn't look like it is working as expected. |
@rodrigogq the generated code you posted runs without error. The input code you posted has a compile error because |
closing in favor of #5207 |
- Order of base types causing issues if base class is declared after. microsoft/TypeScript#4341 - `createResponse` generating invalid code for primitives
* Fixing issues with TS generation - Order of base types causing issues if base class is declared after. microsoft/TypeScript#4341 - `createResponse` generating invalid code for primitives * Add back `ToHashSet()`.
If the super class of B is defined after A you'll get a runtime error.
Just tested the above code in the typescript playground and I get the same error
The text was updated successfully, but these errors were encountered: