carbon-lang
carbon-lang copied to clipboard
Always `==` not `=` in `where` clauses
Instead of having two different operators and semantics when constraining an associated type to be equal to another type variable versus a concrete type, unify the semantics and consistently use just the == operator in where clauses.
Seems like a good change to me. I might remark = feels like assignment, but where feels more like a condition. It might particularly be worth noting that in examples like let PointT:! NSpacePoint where .N = 2;, let supports assignment following so using == to make it read less like an assignment might improve readability.
It might particularly be worth noting that in examples like
let PointT:! NSpacePoint where .N = 2;,letsupports assignment following so using==to make it read less like an assignment might improve readability.
I added this rationale to the alternatives considered: https://github.com/carbon-language/carbon-lang/pull/2070/commits/fefcce63c94cc6cbd52ceb58e7f75bf5c9f21bcc
I'm going to withdraw this proposal in favor of #2173 .