mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Preserve named constraints across where (#7104)
We were not copying named constraints in the base facet type over to the result of the WhereExpr eval. Add tests that cover this by doing `impl as Constraint where ...` with rewrite contraints either in the impl-as or in the named constraint. When the interface is generic, these tests fail (as TODOs). When the impl is used in impl lookup, we crash (with TODOs in the tests). Part of #6991.
This commit is contained in:
@@ -2568,7 +2568,10 @@ static auto AddRequirementBase(Context& context,
|
||||
const auto& base_info =
|
||||
context.facet_types().Get(base_facet_type->facet_type_id);
|
||||
info->extend_constraints.append(base_info.extend_constraints);
|
||||
info->extend_named_constraints.append(base_info.extend_named_constraints);
|
||||
info->self_impls_constraints.append(base_info.self_impls_constraints);
|
||||
info->self_impls_named_constraints.append(
|
||||
base_info.self_impls_named_constraints);
|
||||
info->type_impls_interfaces.append(base_info.type_impls_interfaces);
|
||||
info->type_impls_named_constraints.append(
|
||||
base_info.type_impls_named_constraints);
|
||||
|
||||
Reference in New Issue
Block a user