Circular reference creates Stack Overflow
See original GitHub issueGiven
public class Foo
{
public Bar myBar { get; set; }
}
public class Bar
{
public Foo myFoo { get; set; }
}
TypeGen crashes with stack overflow
Process is terminated due to StackOverflowException.
Giving the type with, eg, [TsType("Foo", "./foo")]
works fine.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Why are circular references considered harmful? [closed]
Circular dependencies between classes are not necessarily harmful. Indeed, in some cases they are desirable.
Read more >code quality - What's wrong with circular references?
Circular object references can crash naïve recursive algorithms (such as serializers, visitors and pretty-printers) with stack overflows.
Read more >Circular reference causes stack overflow · Issue #6
As discussed in pitermarx/NCalc-Edge#14, when using circular references, the Evaluate method leads to a StackOverflowException (which is not ...
Read more >JPA ManyToMany with Eclipselink & GSON circular ...
I have an issue with a manytomany bi-directional JPA relationship that is causing a stack overflow error. when the server is restarted (if ......
Read more >Circular references in JSONSerializer and StackOverflow ...
Circular references causes StackOverflow Exceptions the same as calling a never ending recursive function which crashes all Apps. The ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
1.5.21.5.3 is out - it includes bugfix to this issue plus some other smaller changes.As previously, I’ll keep this thread open for some time.
Thanks; based on your example I was able to replicate this error. It occurs in a different scenario than the one I fixed.
I should be able to fix it in the next release - I’ll chuck in some minor improvements as well, so the next version should be out in a couple of days.