Files
swift-mirror/test/Generics/rdar94854326.swift
Slava Pestov e805339de4 RequirementMachine: Relax assertion in verifyRewriteSystem()
We can end up with a rule that has a protocol symbol on the right hand side:

    X.Y.Z => X.W.[P]

This will occur if X.W.[P] was obtained by simplifying a term X.W.U.V via
a rule (U.V => [P]), and before completion discovers a rule
(X.W.[P] => X.W).

Fixes rdar://problem/94854326, rdar://problem/94980084.
2022-06-17 16:13:42 -04:00

20 lines
392 B
Swift

// RUN: %target-swift-frontend -typecheck %s -debug-generic-signatures 2>&1 | %FileCheck %s
protocol P1 {
associatedtype T: P2 where T.T == Self
}
protocol P2 {
associatedtype T
}
protocol P3: P2 {}
protocol P4 {
associatedtype T
}
// CHECK-LABEL: .G@
// CHECK-NEXT: Generic signature: <T where T : P4, T.[P4]T : P1, T.[P4]T.[P1]T : P3>
class G<T: P4> where T.T: P1, T.T.T: P3 {}