Files
Slava Pestov e975705f35 Sema: Add iteration limit for associated type inference
As described in the Swift generics book, associated type inference is NP-hard.
This is the first report I've seen where this bites in the wild.

We could still accept the test case with a smarter analysis, but for now, let's
diagnose instead of taking a very long time.

I'm setting the limit to a million iterations by default, which makes the test
case fail in about a second. Hopefully we don't have to increase this in practice.
The `-max-associated-type-inference-iterations=` command line flag can be used
to change the limit.

Fixes rdar://problem/168299799.
2026-07-10 12:50:46 -04:00
..
2024-08-29 16:18:14 -04:00