-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Max call stack size exceeded for class expression with extends clause in static method #20695
Comments
Just noticed that my first example also fails with TSC version 2.6.2, both with
|
The loop happens when trying to turn the static type of class C
{
make(): {
new(): { };
make(): any
}
} But it doesn't. I'll need to investigate further to find out how similar cutoffs work; it's a while since I looked at this code. @weswigham have you touched this recently? If so, can you point me in the right direction? |
@sandersn we have a flag that causes us to attempt to write the structure of the class (for handling, eg, mixins (like this)), and the second example isn't even self-referential, so in theory it should print structurally just fine. |
Should be fixed by #24225 |
TypeScript Version: 2.7.0-dev.201xxxxx
Code
Expected behavior:
TSC should not fail to compile with
--declaration
.Actual behavior:
TSC fails with
Maximum call stack size exceeded
:More Details:
Seems like the error is not caused by extending the specific class that owns the static method, but it also fails with other bases:
When the class expression is returned by an instance method though, TSC does not fail:
The text was updated successfully, but these errors were encountered: