mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-17 15:00:28 +00:00
Cycles are defined as reaching two independent lookups in a chain that have all the same types involved. The acyclic rule states that this is not possible and results in an error: https://docs.carbon-lang.dev/docs/design/generics/details.html#acyclic-rule To do this we need to track the types involved in impl lookup. The interface constant includes the whole facet type being looked up, which includes any specific types for generics or where constraints. Thus we just need to compare the constant ids to look for this condition. --------- Co-authored-by: josh11b <15258583+josh11b@users.noreply.github.com>