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:
Dana Jansens
2026-04-24 14:56:48 +00:00
committed by GitHub
parent 680fa0c990
commit 9c9f5cb52c
3 changed files with 127 additions and 2 deletions
+3
View File
@@ -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);