-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[ConstraintSystem] Replace curry level with a boolean flag #19947
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
Since arbitrary currying is no longer allowed `level` could be replaced with the boolean flag which identifies if curried `self` should be skipped or not.
8db4762
to
0baff82
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.
Looks great, thanks!
lib/Sema/CalleeCandidateInfo.h
Outdated
@@ -59,7 +59,7 @@ namespace swift { | |||
/// | |||
struct UncurriedCandidate { |
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.
Perhaps worth renaming this too :)
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.
Are you thinking just to Candidate
? :)
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.
OverloadCandidate maybe
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.
Sounds good! I'll do that in this PR and cleanup documentation around this.
lib/Sema/CSSimplify.cpp
Outdated
@@ -587,13 +587,13 @@ getCalleeDeclAndArgs(ConstraintSystem &cs, | |||
SmallVector<LocatorPathElt, 2> path; | |||
auto callExpr = callLocator.getLocatorParts(path); | |||
if (!callExpr) | |||
return std::make_tuple(nullptr, 0, argLabels, hasTrailingClosure); | |||
return std::make_tuple(nullptr, false, argLabels, hasTrailingClosure); |
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.
When passing ‘false’ as an argument like this it might be more readable if it said: /*hasCurriedSelf=*/false
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, sure, makes sense!
Arbitrary currying is no longer allowed so level could be switched to a boolean flag for methods like `computeDefaultMap` to identify if they need to look through curried self type or not.
0baff82
to
e20723f
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, thanks!
…ype` -> `OverloadCandidate::get{Function}Type`
@swift-ci please test |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@swift-ci please test source compatibility |
1 similar comment
@swift-ci please test source compatibility |
Deserialization failures in debug source compatibility suite are unrelated to my changes. |
Arbitrary currying is no longer allowed so level could be switched
to a boolean flag for methods like
computeDefaultMap
to identifyif they need to look through curried self type or not.