Skip to content
This repository has been archived by the owner on Jul 16, 2023. It is now read-only.

[New rule] Prohibiting the use of recursions, including tail recursions. #554

Open
1 task
PlugFox opened this issue Nov 11, 2021 · 0 comments
Open
1 task
Assignees
Labels
area-rules good first issue Good for newcomers type: enhancement New feature or request

Comments

@PlugFox
Copy link

PlugFox commented Nov 11, 2021

Prohibiting the use of recursions, including tail recursions.
Because dart lack off support tail call optimisation and you can obtain Maximum call stack size exceededError.

And after that recursion is more resource demanding then normal loops.

  • Warns about a potential error (problem)

Dartpad example

void main() => fn(0);

int fn(int i) {
  print(i++);
  return fn(i);
}
@incendial incendial added area-rules good first issue Good for newcomers type: enhancement New feature or request labels Nov 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-rules good first issue Good for newcomers type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants