There is no feature/property helps in avoiding infinite loops. Can we have a timeout option and max number of loops(both are not mandatory) to help developers to handle this scenario?
Would be a much useful feature for code-reviewers too. They can enforce that either one of them have to be mandatorily handled.