[Chapel Merge] Fix some bugs with operator methods during functio

Branch: refs/heads/master
Revision: e19cf97
Author: lydia-duncan
Log Message:

Merge pull request #17833 from lydia-duncan/outErrorInvest

Fix some bugs with operator methods during function resolution
[reviewed by @mppf]

Turns out, we weren't adjusting for when the assignment call could be a operator
method, so were missing important handling that replaced split-init out
argument assignments with PRIM_MOVE. This meant we had extra calls to
the assignment operator when the operator was defined as a method.

Resolves #17429
Resolves Cray/chapel-private#1947

This was the case that motivated this investigation. Other issues fixed include:

  • Checks for assigning nil to records were not adjusting for the possibility of
    the assignment operator being an operator method (though I'm not entirely
    convinced this case would trigger, as the assignment function I was looking at
    didn't trigger the "is a record" portion because it's a ref argument even though
    the type it is a ref to is a record).
  • Also, postFold double checking that a param is assigned multiple times was not
    appropriately adjusting for operator method calls.

With the first bug fixed, five tests can now be updated to use operator methods
instead of standalone operator functions.

Passed a full paratest with futures

Modified Files:
M compiler/passes/splitInit.cpp

M compiler/resolution/functionResolution.cpp
M compiler/resolution/postFold.cpp
M compiler/resolution/resolveFunction.cpp
M test/types/chplhashtable/test-chpl-hashtable.chpl
M test/types/records/intents/out-intent.chpl
M test/types/records/split-init/inner-fn.chpl
M test/types/records/split-init/split-init-global1.chpl
M test/types/records/split-init/split-init-out-on.chpl

Compare: https://github.com/chapel-lang/chapel/compare/520d493118a0...e19cf97576b0