Closed pcj closed 6 years ago
I've used recursive templates on purpose a few times (traversing a tree structure with some terminal conditions), so I don't think we'd want to prevent that functionality outright. I did attempt to add a "stack trace" style error reporting to rendering errors in #35 which might make it obvious when a situation like this occurs that wasn't intended.
We could do something like keep track of how many times the same template appears in the call chain and deliberately crash with a helpful message when it's more than e.g. 100, but that doesn't seem super easy so I doubt that I'll get to it at any point. Contributions welcome
This was a stupid error on my part, but it took a few minutes to figure out what I had done wrong. Would be nice to track which methods have been called and report a 'recursive template invocation' message to the user. Example is simplified.