-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Constraint simplification cleanups #21818
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
Constraint simplification cleanups #21818
Conversation
b6b3da6
to
c510ea4
Compare
@swift-ci Please test source compatibility |
@swift-ci Please smoke test |
@xedin I'm slowly untangling more code around InOutType and LValueType... also with these changes I observed a very small reduction in number of constraints, etc. But not nearly enough to measure. |
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. FYI @rudkx and I mostly shy away from using Bind
too much because (sometimes) it merges types too early and binding calculation code misses some potential bindings as a result, or (I saw that at least ones) causes infinite recursion because of isBindable
check re-creates bind constraint infinitely if it fails.
@xedin Is it possible that something else was fixed along the way? The only remaining uses of Equal are in keypaths. |
@xedin The commit "Sema: Solve Bind constraints involving to two variables of different lvalue-ness" fixes https://bugs.swift.org/browse/SR-9068 |
@slavapestov Most likely yes, we had a bunch of bind constraints introduced by hacks in PreCheckExpression and other places like contractEdges, which got fixed at some point... |
…lvalue-ness The restriction here only applies to Equal constraints. Fixes <rdar://problem/45511838>, <https://bugs.swift.org/browse/SR-9068>.
- Avoid creating an unnecessary type variable - Even if both sides are type variables we can solve them if the LHS cannot bind to an InOut or the RHS cannot bind to an LValue; in this case the two types are identical and we can merge them
c510ea4
to
5f4933b
Compare
@swift-ci Please test |
@swift-ci Please test source compatibility |
@swift-ci Please test |
@swift-ci Please test source compatibility |
5f4933b
to
52c1c8c
Compare
@swift-ci Please test |
@swift-ci Please test source compatibility |
1 similar comment
@swift-ci Please test source compatibility |
@swift-ci Please test |
The failure is a UPASS because the bug was fixed. |
swiftlang/swift#21818 makes it work again. https://bugs.swift.org/browse/SR-9068
Updated the source compat suite. Next time, can you get that too when you merge a fix? :-) |
Fixes rdar://problem/45511838, https://bugs.swift.org/browse/SR-9068.