Skip to content

fix(translating): fix len(array) as function argument being translated into array reference - #1163

Open
Tirito6626 wants to merge 10 commits into
stagingfrom
fix-array-len-func-argument
Open

Tirito6626 wants to merge 10 commits into
stagingfrom
fix-array-len-func-argument

Conversation

@Tirito6626

@Tirito6626 Tirito6626 commented Aug 23, 2026 •

Copy link
Copy Markdown
Member

closes #1162

  • fixes len(array), passed as function argument, being translated into array reference instead of its ephemeral variable value with length prefix
  • adds tests for both Text and Array length as function argument

Summary by CodeRabbit

  • Bug Fixes

    • Improved array length handling when passing values to functions.
    • Preserved expected quoting for indexed and whole-array arguments.
    • Improved compatibility for reference-bound arrays across supported shells.
    • Prevented unused function return values from being retained in statement-only calls.
  • Tests

    • Added coverage for passing text and array lengths as function arguments.

@coderabbitai

This comment was marked as outdated.

coderabbitai[bot]

This comment was marked as outdated.

@codecov

codecov Bot commented Aug 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 33.33333% with 16 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/modules/function/invocation.rs 33.33% 16 Missing ⚠️

📢 Thoughts on this report? Let us know!

@Tirito6626
Tirito6626 requested a review from Ph0enixKM August 29, 2026 09:02

This branch has not been deployed

No deployments
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.

[BUG] len function passes garbage value when evaluated as an argument.

1 participant