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