-
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
RangeError: Maximum call stack size exceeded #9390
Comments
I know it's an exotic kind of type constraint usage and I'm not very surprised it didn't work. I just reported it because the compiler probably is not supposed to crash. |
BTW: what I was trying to do: Problem: I want to be able to define a "sparse" item with only some of the otherwise mandatory properties present. My approach: When I want to pass it to methods that expect an object of interface var item = <Item><any>sparseItem; would have done the job, but not very safely. So I thought I could wirte a var item:Item = cast<SparseItem, Item>(sparseItem); My goal:
|
This should be flagged as an error by the compiler. a type parameter can not depend on itself, this is not supported. |
Fixed in 3.8 |
While playing around with generic type constraints, I came across a bug in the typescriptServices.js used on the ts playground:
TypeScript Version: 1.8.2 (66d9c92bd3d6127ed3142876bc1a446bbd8395de)
Code
Expected behavior:
A (meaningful) compile error or compiled code or both
Actual behavior:
RangeError: "Maximum call stack size exceeded" and no compile result in TS Playground with this code.
The text was updated successfully, but these errors were encountered: