-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Initial support for constraints formed by combining interfaces #1307
Initial support for constraints formed by combining interfaces #1307
Conversation
Very little works right now.
scope. This allows us to later find the sub-impls and pull out the right witness.
different syntactic forms.
to non-types. Change printing from using `=` to using `==` in line with discussion in weekly sync meeting.
}; | ||
|
||
// A collection of values that are known to be the same. | ||
struct EqualityConstraint { |
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.
Using a vector
to keep track of equalities is likely to be inefficient. A better data structure for this purpose is union-find
.
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.
Yeah, I have a TODO to add something more efficient, but any such approach depends on us having some way of looking up Value
s that's more efficient than a linear scan (such as hashing or canonicalization or similar). Do you want this addressed before this patch lands, or can we work on that as a separate step?
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.
Given the approval, I'm assuming it's fine to address this later :)
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.
yes
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.
This PR looks good! Thanks Richard. I'll mark this as approved and leave it up to you to handle the minor comments/suggestions.
Add scaffolding for constraints in general, and support specifically constraints formed by applying a `&` operator. No support for constraints formed with `where` nor for named constraints at this point.
Add scaffolding for constraints in general, and support specifically constraints formed by applying a
&
operator.No support for constraints formed with
where
nor for named constraints at this point.