[Chapel Merge] test: change decl from `ref` to `var` and add futu

Branch: refs/heads/main
Revision: c069e86
Author: arezaii
Link: test: change decl from `ref` to `var` and add future for `ref` version by arezaii · Pull Request #19357 · chapel-lang/chapel · GitHub
Log Message:

Merge pull request #19357 from arezaii/string-leak-test

test: change decl from ref to var and add future for ref version

This PR updates the declaration of a variable in a test from ref to var.

When troubleshooting failing tests with the dyno parser, we discovered
that this test declared a ref to the vararg formal, which is itself
returned as a ref, so this should have produced a type or lifetime error
in the current compiler. However, it was compiling and running because
internally it was converting the ref to a const val. Redeclaring the
variable as a var keeps tests passing.

Captured the existing test as a future referring to issue
Capturing `const ref` argument as mutable `ref` should be an error · Issue #19614 · chapel-lang/chapel · GitHub.


  • [x] paratest
  • [x] paratest with --dyno (602 failures)

reviewed by @mppf - thanks!

Signed-off-by: arezaii ahmad.rezaii@hpe.com

Modified Files:
A test/functions/varargs/stringVarargLeakByRef.chpl

A test/functions/varargs/stringVarargLeakByRef.future
A test/functions/varargs/stringVarargLeakByRef.good
M test/functions/varargs/stringVarargLeak.chpl

Compare: https://github.com/chapel-lang/chapel/compare/fd64ed75cbcf...c069e86fb9f4