-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(for): correct semantics for "for" without "in" #348
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
shell.trace_command(std::format!( | ||
"for {} in {}", | ||
self.variable_name, | ||
unexpanded_values.iter().join(" ") | ||
))?; | ||
} else { | ||
shell.trace_command(std::format!("for {}", self.variable_name,))?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The trace message for the case without 'in' is unclear. It should indicate that positional parameters are being used. Suggestion: shell.trace_command(std::format!("for {} (using positional parameters)", self.variable_name))?;
shell.trace_command(std::format!("for {}", self.variable_name,))?; | |
shell.trace_command(std::format!("for {} (using positional parameters)", self.variable_name))?; |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
Test Results 3 files 14 suites 6m 6s ⏱️ Results for commit f08c055. |
Performance Benchmark Report
Code Coverage Report: Only Changed Files listed
Minimum allowed coverage is |
When
in
is not specified with afor
clause, we need to enumerate positional arguments instead (i.e., $@).This scenario was getting parsed correctly, but not correctly interpreted.
Resolves #342. Thanks to @ko1nksm for identifying the problem and filing a bug report on it!