carbon-lang
carbon-lang copied to clipboard
Associated constant assignment versus equality
trafficstars
Split the where A == B constraint in two: where .A = B produces a new
constraint from an old one, where the value of .A in the new constraint is
known and eagerly rewritten to B, and where A == B, which does not cause
A and B to be considered as identical by language rules but does permit
implicit (no-op) conversion between them.
This aims to provide an efficiently-computable and human-understandable type equality rule, with type canonicalization and therefore transitive type equality, without sacrificing too much in the way of ergonomics and without sacrificing determinism, while still providing the full power of a general type constraint system in a less ergonomic form.