mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-16 03:58:13 +00:00
In a facet type constraint, you can write `where .Self impls T` for any facet type `T`, or the constant `type`. It is possible to write `type` in different ways though, with a `NameRef` instruction appearing on the RHS instead of `TypeType`. In this case, the canonical constant value's instruction will still be `TypeType`, so make eval look at the canonical instruction to see this. Add a test with an `alias Type = type` which hits this case. After this change, we only will accept and find one of the following on the RHS of `impls`: - `TypeType` - A facet type - An error, if the source code had something else there, which will already be diagnosed. Tested by `fail_right_of_impls_non_type.carbon` and `fail_right_of_impls_non_facet_type.carbon`. So we handle these three cases, and drop the implicit handling of other things which will never appear there.