File: issue-52042.swift

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (37 lines) | stat: -rw-r--r-- 1,418 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// RUN: %target-swift-frontend -debug-generic-signatures -typecheck %s 2>&1 | %FileCheck %s

// https://github.com/apple/swift/issues/52042

protocol R {}

protocol Q {
  associatedtype Assoc
}

// CHECK-LABEL: .P1@
// CHECK-LABEL: Requirement signature: <Self where Self.[P1]T == Self.[P1]U.[P1]U, Self.[P1]U : P1, Self.[P1]U : Q, Self.[P1]U == Self.[P1]T.[P1]U, Self.[P1]U.[Q]Assoc : R>
protocol P1 {
  associatedtype T where T == U.U
  associatedtype U : P1, Q where U.Assoc : R, U == T.U
}

// CHECK-LABEL: .P2@
// CHECK-LABEL: Requirement signature: <Self where Self.[P2]T == Self.[P2]U.[P2]U, Self.[P2]U : P2, Self.[P2]U : Q, Self.[P2]U == Self.[P2]T.[P2]U, Self.[P2]U.[Q]Assoc : R>
protocol P2 {
  associatedtype T : P2 where T == U.U
  associatedtype U : P2, Q where U.Assoc : R, U == T.U
}

// CHECK-LABEL: .P3@
// CHECK-LABEL: Requirement signature: <Self where Self.[P3]T : Q, Self.[P3]T == Self.[P3]U.[P3]U, Self.[P3]U : P3, Self.[P3]U == Self.[P3]T.[P3]U, Self.[P3]T.[Q]Assoc : R>
protocol P3 {
  associatedtype T : Q where T.Assoc : R, T == U.U
  associatedtype U : P3 where U == T.U
}

// CHECK-LABEL: .P4@
// CHECK-LABEL: Requirement signature: <Self where Self.[P4]T : Q, Self.[P4]T == Self.[P4]U.[P4]U, Self.[P4]U : P4, Self.[P4]U == Self.[P4]T.[P4]U, Self.[P4]T.[Q]Assoc : R>
protocol P4 {
  associatedtype T : P4, Q where T.Assoc : R, T == U.U
  associatedtype U : P4 where U.Assoc : R, U == T.U
}