-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Avoid more constraints in result if trying views #24369
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
base: main
Are you sure you want to change the base?
Conversation
5eb0d10 to
02b1caa
Compare
odersky
left a comment
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.
Nicely spotted! I have just one small change request.
| case MethodType(ContextBoundParamName(_) :: _) => sourceVersion.isAtLeast(`3.4`) | ||
| case _ => false | ||
| */ | ||
| val needsUsing = true //wtp.isImplicitMethod is asserted at beginning of method |
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.
It seems to me that we should keep the second condition for needsUsing. We don't want to change behavior under -source 3.3.
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.
Ah, I guess the || was a boolean typo for &&.
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.
Ah, my bad. At this point I don't know anymore what was intended. Never mind, we can keep it as is.
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.
I'll spend a few minutes to think of a counter-example. More tests would be nice, and the details of the PR are already receding into the fogs of time.
02b1caa to
f3339f3
Compare
f3339f3 to
6b089ed
Compare
6b089ed to
e351107
Compare
|
It now always takes The latter fix is not needed when Maybe further tweakage is possible, but not pursued here. |
In
canProfitFromMoreConstraints, balk ifmode.is(ImplicitExploration).The failing case was due to the
constrainResult"up the stack" inadaptNoArgs, which drove type comparisons and completions, including a conversion. TheFunProtocontext had a console reporter that emitted the errors encountered, not an exploring reporter.The justification is that "more constraints" is motivated by arg inference, so if the arg is already involved in views, further information in the result is not needed, especially at the cost of spurious exploratory errors using a context that doesn't reflect the current mode.
Fixes #24192