mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 21:00:13 +01:00
This enables searching facets like `T:! Z where .Z1 impls Y` for queries like `T.Z1 as Y`, etc. Any facet in the query self or the query target type may provide a witness for the requirements of the impl lookup, so search through them all. We accept partially identified facet types in the query self, since `Self` can be used inside a named constraint before it's fully identified. But any use of `Self` being converted would put it in the query self, not the query target, which would be some generic parameter facet type that a type involving `Self` is being converted to. TypeIterator is expanded to support this use case, by giving it the ability to walk through FacetType's extend/impls constraints. We return the facet values that we find in the iterator instead of a type id. And we also include FacetValue instructions as an iterator step for clients that want them, while also recursing through them.