-
Notifications
You must be signed in to change notification settings - Fork 10.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression: "Cannot build interface type for term" crash during compilation #61192
Comments
@slavapestov This may be in your wheelhouse? |
I worked around the problem by replacing the With where Bytes == Parsers.MapConversion<Parsers.ReplaceError<Rest<Data>>, C> { |
Nice, I was about to suggest the same workaround but you beat me to it. Here is a reduced test case: struct Data {}
protocol Parser {
associatedtype Input
}
struct Rest<Input>: Parser {}
struct Body<Bytes: Parser> where Bytes.Input == Data {
init<C: Parser>(_: C) where Bytes == Rest<Bytes.Input>, C.Input == Bytes.Input {}
} |
The problem is that the requirement |
The regression was introduced by #60507, but it's exposing an existing bug which needs to be fixed in a more fundamental way. |
…e equivalence classes This fixes an edge case where we start with the following requirements: - U : P - T : P - T.[P]A == C - T == G<T.[P]A> - U.[P]A == T.[P]A and end up with the following set of minimal rules (where the type witness for [P]A in the conformance G<C> : P is C): - U.[P] => U - U.[P:A] => T.[P:A] - T.[concrete: G<C>] => T - T.[concrete: G<C> : P] => T Since U.[P]A and T.[P]A are concrete, we split the abstract same-type requirement into two requirements, and re-run minimization: - U : P - T.[P]A == C - U.[P]A == C - T == G<C> The concrete conformance rule T.[concrete: G<C> : P] => T does not correspond to a requirement, so it was simply dropped, and the above rules violate post-contraction invariants; T.[P]A is not a valid type parameter because there is no conformance requirement T : P in the minimized signature. We can fix this by re-running concrete contraction after splitting concrete equivalence classes. After contraction, the above requirements turn into - U : P - C == C - U.[P]A == C - T == G<C> Which correctly minimizes to - U : P - U.[P]A == C - T == G<C> Both concrete contraction and concrete equivalence classes are hacks, and we should think of a way to directly express the transformations they perform with the rewrite system. Fixes swiftlang#61192.
swift-url-routing no longer crashes when built with my fix. |
Describe the bug
A project that built fine in Xcode 14.0 crashes during compilation in Xcode 14.1.
Steps To Reproduce
Steps to reproduce the behavior:
Clone the repo and check out the affected tag:
git clone https://github.com/pointfreeco/swift-url-routing cd swift-url-routing git checkout 0.3.0
Open in Xcode 14.1.
Build the
URLRouting
target.Expected behavior
It builds.
Actual behavior
Screenshots
If applicable, add screenshots to help explain your problem.
Environment (please fill out the following information)
Additional context
Related: pointfreeco/swift-url-routing#52
The text was updated successfully, but these errors were encountered: