mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 19:41:05 +01:00
Add storage for <type> impls <facettype> in the FacetTypeInfo (#7005)
We don't yet actually add any in check, but this adds the storage for them, and capabilities to import them, evaluate them, substitute into them with specifics, name them, format them, and stringify them. --------- Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
This commit is contained in:
co-authored by
Chandler Carruth
parent
912825feaf
commit
451b50a3ad
@@ -744,7 +744,24 @@ class Stringifier {
|
||||
step_stack_->PushString(" .Self impls ");
|
||||
some_where = true;
|
||||
}
|
||||
// TODO: Other restrictions from facet_type_info.
|
||||
for (const auto& type_impls :
|
||||
llvm::reverse(facet_type_info.type_impls_interfaces)) {
|
||||
if (some_where) {
|
||||
step_stack_->PushString(" and");
|
||||
}
|
||||
step_stack_->Push(type_impls.self_type, " impls ",
|
||||
type_impls.specific_interface);
|
||||
some_where = true;
|
||||
}
|
||||
for (const auto& type_impls :
|
||||
llvm::reverse(facet_type_info.type_impls_named_constraints)) {
|
||||
if (some_where) {
|
||||
step_stack_->PushString(" and");
|
||||
}
|
||||
step_stack_->Push(type_impls.self_type, " impls ",
|
||||
type_impls.specific_named_constraint);
|
||||
some_where = true;
|
||||
}
|
||||
if (some_where) {
|
||||
step_stack_->PushString(" where");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user