mirror of
https://github.com/apple/swift.git
synced 2026-10-10 13:50:43 +02:00
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.