Files
swift-mirror/test/Generics/rdar94980084.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

12 lines
418 B
Swift

// RUN: %target-swift-frontend -typecheck %s -debug-generic-signatures 2>&1 | %FileCheck %s
struct G<Value> {}
protocol P {
associatedtype T
}
// CHECK-LABEL: ExtensionDecl line={{.*}} base=G
// CHECK-NEXT: <Value where Value : P, Value.[P]T : CaseIterable, Value.[P]T.[CaseIterable]AllCases : RandomAccessCollection>
extension G where Value: P, Value.T: CaseIterable, Value.T.AllCases: RandomAccessCollection {}