Skip to content

Conversation

slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Oct 3, 2025

This used to crash instead of diagnosing:

protocol P1 { associatedtype A: P1 }
protocol P2 { associatedtype A: P2 }
protocol P12: P1, P2 {}

Fixes rdar://147277543.

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

…ite system for protocol

If we failed to construct a rewrite system for a protocol, either because
the Knuth-Bendix algorithm failed or because of a request cycle while
resolving requirements, we would end up in a situation where the resulting
rewrite system didn't include all conformance requirements and associated
types, so name lookup would find declarations whose interface types are
not valid type parameters.

Fix this by propagating failure better and just doing nothing in
getReducedTypeParameter().

Fixes rdar://147277543.
@slavapestov slavapestov force-pushed the rqm-protocol-failure-bookkeeping branch from 3f33000 to 244d2af Compare October 4, 2025 13:17
@slavapestov slavapestov merged commit 811a201 into swiftlang:main Oct 5, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant