-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Named arg may be deprecatedName #21588
base: main
Are you sure you want to change the base?
Conversation
23dfe91
to
be1097e
Compare
Taking the prefix of both named and positional args while no positions change results in Edit: that was the line of the test I was reading a year ago at #18363 (comment) If that is the only casualty and both messages are correct, then the change may be acceptable if not desirable. |
An interesting pc test failure involving overloading and polytypes. |
be1097e
to
a3ad70c
Compare
That is
where
Edit: during overload res, when considering the next param list, raw paramss are set to the value params, but the info is not stripped. Not sure the workaround belongs in |
a3ad70c
to
e783d37
Compare
The last bit was to use I especially like the fringe improvement to i18122. I know stdlib has some deprecated param names; and it's possible that named args are underused in general; how many lives does the ability to migrate param names either improve or save outright? |
For a method definition
emit a deprecation warning if
x
,y
, orw
are named in an application.Fixes #19077
Supersedes #19086
The check for a deprecated name is when an arg is deemed missing: that is when draining the list of args and the current arg is named. Instead of
missingArgs = true
, first check whether this arg is a deprecated name for the current parameter. Fix up that arg to use the canonical name and continue.handlePositional
also consumes leading named args that are in position. Common applications such asf(i, b = true, j)
need nothandleNamed
.Checking for a deprecated name is expensive but only happens for named args. (Looking for the deprecated name as a fallback would be fine, but every named arg is checked; that is not usually every arg.)