Skip to content

Disqualify graph traversal for loops - #70

Merged
alexkohler merged 1 commit into
alexkohler:masterfrom
NathanBaulch:graphloops
Feb 12, 2026
Merged

Disqualify graph traversal for loops#70
alexkohler merged 1 commit into
alexkohler:masterfrom
NathanBaulch:graphloops

Conversation

@NathanBaulch

@NathanBaulch NathanBaulch commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

The following is a common pattern for traversing linked lists or tree node ancestors:
for n := first(); n != nil; n = n.next() {
There's no way to determine the iteration count statically for for loops that advance the loop variable with a function call, so these need to be disqualified.

At some point I'd like to enable the --forloops option by default once we can reliably handle these common for loop patterns.

@alexkohler

Copy link
Copy Markdown
Owner

At some point I'd like to enable the --forloops option by default once we can reliably handle these common for loop patterns

Agree! Thanks again for all of the PRs + improving prealloc 🚀

@alexkohler
alexkohler merged commit c6b3bb5 into alexkohler:master Feb 12, 2026
1 check passed
@NathanBaulch
NathanBaulch deleted the graphloops branch February 12, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants