[Chapel Merge] Fix "var x = nil;"

Branch: refs/heads/main
Revision: e222ec5
Author: vasslitvinov
Link: Fix "var x = nil;" by vasslitvinov · Pull Request #19676 · chapel-lang/chapel · GitHub
Log Message:

Merge pull request #19676 from vasslitvinov/fix--var_x_=_nil;

Fix "var x = nil;"

Resolves #19244

This changes enables the compiler to compile code like this:
var x1 = nil;
var x2 = c_nil;

which used to cause assertion failures during --no-local compilations.

Note that #19672 proposes to disallow this code.
That will likely make this fix unnecessary.

While there:

  • Enable nil-variable-elimination upon --local.
    Previously it was done only during --no-local compilations.

  • Resolve, unintentionally, a gasnet --verify failure in
    test/library/packages/canCompileNoLink/HDFStest.chpl

r: @lydia-duncan

Modified Files:
A test/classes/vass/var_x_=_nil.chpl

A test/classes/vass/var_x_=_nil.good
M compiler/passes/insertWideReferences.cpp

Compare: https://github.com/chapel-lang/chapel/compare/cf32ab107109...e222ec59ff56