question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Infinite Recursion

See original GitHub issue

I’d like to request a feature. I’m using an object in a test that has a child that refers back to the parent. This causes an infinite loop when I run the test. If there could be a way to set the number of levels of recursion, it would be very nice.

Here’s an example, in case i was not clear:

public class Parent {
    public Child Child { get; set; }
}

public class Child{
    public Parent Parent { get; set; }
}

var parent1 = new Parent();
parent.Child = new Child{ Parent = parent };

var parent2 = new Parent();
parent.Child = new Child{ Parent = parent };

parent1.ToExpectedObject().ShouldEqual(parent2); // <--- infinite loop

Issue Analytics

  • State:closed
  • Created 11 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
stocksrcommented, May 20, 2016

could this be released?

0reactions
derekgreercommented, Aug 26, 2017

This has been fixed in v1.3.1.

Read more comments on GitHub >

github_iconTop Results From Across the Web

infinite recursion - Wiktionary, the free dictionary
(programming) Any recursion that continues without end. Related termsEdit · crock recursion. TranslationsEdit. ±show ...
Read more >
4.8. Infinite Recursion — How to Think ...
If a recursion never reaches a base case, it will go on making recursive calls forever and the program will never terminate. This...
Read more >
Recursion - Wikipedia
Recursion occurs when the definition of a concept or process depends on a simpler version of ... While this apparently defines an infinite...
Read more >
Avoiding unintentional infinite recursion - Using Swift
I'm starting this thread to discuss any code analysis tools or strategies that can be used for avoiding unintentional infinite recursion.
Read more >
StackOverflowError and the concept of Infinite Recursion
This method call never ends, once java realises that there is no more room in the stack, it throws the error. This concept...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found