[Chapel Merge] Fix default arguments for dynamically dispatched m

Branch: refs/heads/master
Revision: c7478ed
Author: bradcray
Log Message:

Merge pull request #17653 from bradcray/fix-dyn-dispatch-default-args

Fix default arguments for dynamically dispatched methods

[reviewed by @mppf]

This is a partial fix to problems reported in #7880, #17649, and #15164
in which the default arguments for a dynamically dispatched routine use
the defaults for the static class type's version of the method rather
than the dynamic class's. The issue was that the methods that the
compiler introduces to represent the default values were tagged as
being param which prevented them from being dynamically dispatched.
This PR takes the approach of not applying the param tag to the
methods that compute the default values in order to have them dynamically
dispatch. However, I call it a partial fix because if the argument itself
is a param, things still fall back to the old behavior. Fixing this is a more
significant effort that I've spun off to issue #17683 (which also contains
some notes on how we might address it).

Big thanks to @mppf for providing the necessary context and pointers
to be able to solve this somewhat quickly.

Resolves #7880
Resolves #17649
Resolves #15164 (partially... the unresolved case remains in #17683)

Modified Files:
A test/functions/default-arguments/default-argument-class-override1a.chpl

A test/functions/default-arguments/default-argument-class-override1a.good
A test/functions/default-arguments/default-argument-class-override1b.chpl
A test/functions/default-arguments/default-argument-class-override1b.good
A test/functions/default-arguments/default-argument-class-override2.chpl
A test/functions/default-arguments/default-argument-class-override2.good
A test/functions/default-arguments/default-argument-class-override3.chpl
A test/functions/default-arguments/default-argument-class-override3.good
A test/functions/default-arguments/default-argument-class-override3a.bad
A test/functions/default-arguments/default-argument-class-override3a.chpl
A test/functions/default-arguments/default-argument-class-override3a.future
A test/functions/default-arguments/default-argument-class-override3a.good
R test/functions/default-arguments/default-argument-class-override.bad
R test/functions/default-arguments/default-argument-class-override.future
M compiler/resolution/wrappers.cpp
M test/classes/deitz/dispatch/test_dd2.good
M test/functions/default-arguments/default-argument-class-override.chpl
M test/functions/default-arguments/default-argument-class-override.good

Compare: https://github.com/chapel-lang/chapel/compare/2b3f21f4b99a...c7478ed4e391