mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 19:31:08 +01:00
Initial support for empty named constraints (#6245)
Type check named constraint decls and definitions. We don't correctly error if you put a `fn` inside them. There is no support for `require` or `alias` yet, so there's nothing useful you can do with them yet. We have attempted to share code between `interface` and `constraint` as they are quite similar. First by splitting out some of handle_interface.cpp to a separate file. Second by sharing some code paths when you want a facet type from either one, as they both turn into a facet type.
This commit is contained in:
@@ -437,6 +437,16 @@ class Stringifier {
|
||||
">");
|
||||
}
|
||||
|
||||
auto StringifyInst(InstId /*inst_id*/, GenericNamedConstraintType inst)
|
||||
-> void {
|
||||
const auto& constraint =
|
||||
sem_ir_->named_constraints().Get(inst.named_constraint_id);
|
||||
*out_ << "<type of ";
|
||||
step_stack_->Push(StepStack::QualifiedNameItem{constraint.parent_scope_id,
|
||||
constraint.name_id},
|
||||
">");
|
||||
}
|
||||
|
||||
// Determine the specific interface that an impl witness instruction provides
|
||||
// an implementation of.
|
||||
// TODO: Should we track this in the type?
|
||||
|
||||
Reference in New Issue
Block a user