-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Restrict implicit args to using #22458
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
Conversation
Aspirationally, Since issueErrors specifies endPos, the position used for That needs a mechanism for distinguishing user's using from typing for default args, where user expr requires underlining, but the latter case wants trailing caret. |
I'm in my exam period until 05/02, so I won't be able to review before then. I'll be happy to take a look once I can though. |
@mbovel you were in this area last spring, and the LOC I restored will be familiar to you. (Maybe over-familiar.) If you wouldn't mind revisiting it for a review? This commit tweaks Eugene's previous fix by tweaking your previous fix. |
56a9d3b
to
32c0f84
Compare
32c0f84
to
f43543f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Very nice cleaning!
2a8b6d8
to
24eac57
Compare
just a rebase |
Just realized that the new error is the fixed ticket: the code has spurious parens.
|
24eac57
to
2af66ef
Compare
I appreciate the explanatory comment from January, but frankly it's not very meaningful to me right now in March. OK, after reading it a couple of times, I kind of understand it. Additionally, a reminder that it's always futile to update vulpix check files "by hand". The "div" line will be some width you did not anticipate (and not the width in your terminal window). It would be nice if there were a |
Typer#adaptNoArgsImplicitMethod populates implicit args when an arg list is missing. To remedy missing implicits, it tries a named application `using` args it did find. Then Applications#tryDefault supplies a default arg if available. A previous fix to allow tryDefault to supply implicit args for `implicit` params is now restricted to explicit `using`; typer now adds `using` for `implicit` when it needs to try defaults. This commit restores propagatedFailure and the previous condition that default params are tried if there is an error that is not an ambiguity. An additional restriction is that default params must be useful: there must be a param which has a default arg to be added (because it's not a named arg).
2af66ef
to
c37dc8b
Compare
Any idea if it's safely portable to LTS? Or is it even needed to be back ported? |
@tgodzik I remember the code has history over the past 12 months, which suggests that it would be desirable on LTS. I can try it out and update this comment. (The delta is not trivial.) |
I will try to backport it then if possible. |
It cherry-picks, FWIW. The |
Typer#adaptNoArgsImplicitMethod populates implicit args when an arg list is missing. To remedy missing implicits, it tries a named application
using
args it did find. Then Applications#tryDefault supplies a default arg if available. A previous fix to allow tryDefault to supply implicit args forimplicit
params is now restricted to explicitusing
; typer now addsusing
forimplicit
when it needs to try defaults.This commit restores propagatedFailure and the previous condition that default params are tried if there is an error that is not an ambiguity. An additional restriction is that default params must be useful: there must be a param which has a default arg to be added (because it's not a named arg).
Fixes #22439