Skip to content

Count a for-range loop variable's start expression as a read - #1301

Merged
Frotty merged 2 commits into
masterfrom
fix/for-range-start-expression-read
Sep 10, 2026
Merged

Frotty merged 2 commits into
masterfrom
fix/for-range-start-expression-read

Conversation

@Frotty

@Frotty Frotty commented Sep 10, 2026

Copy link
Copy Markdown
Member

for i = a downto 0 reported "The assignment to local variable a is never read" for the preceding let a = 10, because the dataflow analysis only inspects a compound statement's direct Expr children, and a for-range loop's start expression belongs to the loop variable's LocalVarDef rather than to the loop statement itself — so the read was never recorded. The same workaround already existed for SwitchStmt, whose expressions are likewise not direct children.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-10T10:47:51.667126Z e577d4b Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e1565dfd8b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Frotty

Frotty commented Sep 10, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: e577d4bf05

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Frotty
Frotty merged commit fe03ac3 into master Sep 10, 2026
3 checks passed
@Frotty
Frotty deleted the fix/for-range-start-expression-read branch September 10, 2026 10:52
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.

1 participant