命名约束的实现不会继承关联常量的值

作者: zygoloid创建于 2026年3月30日更新于 2026年9月28日
标签inactivelong term issuetoolchain

考虑以下情况:

carbon
constraint Add {
  extend require impls Core.AddWith(Self) where .Result = Self;
}
尝试 `impl X as Add` 会被拒绝,因为关联的常量 `Result` 没有赋值:
```carbon
class X {}
impl X as Add {
  fn Op[self: Self](a: Self) -> Self { return {}; }
}

内容来源: carbon-language/carbon-lang