File: rdar83308672.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 (56 lines) | stat: -rw-r--r-- 1,646 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// RUN: %target-typecheck-verify-swift -debug-generic-signatures 2>&1 | %FileCheck %s

// CHECK: rdar83308672.(file).A@
// CHECK-NEXT: Requirement signature: <Self where Self == Self.[A]X.[P1]T, Self.[A]X : P1, Self.[A]Y : P2>
protocol A {
  associatedtype X : P1
  associatedtype Y : P2
    where X.T == Self
}

// CHECK: rdar83308672.(file).P1@
// CHECK-NEXT: Requirement signature: <Self>
protocol P1 {
  associatedtype T
}

// CHECK: rdar83308672.(file).P2@
// CHECK-NEXT: Requirement signature: <Self where Self.[P2]T : B>
protocol P2 {
  associatedtype T : B
}

// CHECK: rdar83308672.(file).B@
// CHECK-NEXT: Requirement signature: <Self where Self.[B]X == Self.[B]Y>
protocol B {
  associatedtype X
  associatedtype Y
    where X == Y
}

// Note that T.X == T.Y implies T : B, but also T : B implies T.X == T.Y;
// we can drop one requirement but not both.

// CHECK: rdar83308672.(file).G1@
// CHECK-NEXT: Requirement signature: <Self where Self.[G1]T : A, Self.[G1]T.[A]X == Self.[G1]T.[A]Y>
protocol G1 {
  associatedtype T : A where T.X == T.Y
}

// CHECK: rdar83308672.(file).G2@
// CHECK-NEXT: Requirement signature: <Self where Self.[G2]T : A, Self.[G2]T.[A]X == Self.[G2]T.[A]Y>
protocol G2 {
  associatedtype T : A where T : B, T.X == T.Y
}

// CHECK: rdar83308672.(file).G3@
// CHECK-NEXT: Requirement signature: <Self where Self.[G3]T : A, Self.[G3]T.[A]X == Self.[G3]T.[A]Y>
protocol G3 {
  associatedtype T : A where T.X == T.Y, T : B
}

// CHECK: rdar83308672.(file).G4@
// CHECK-NEXT: Requirement signature: <Self where Self.[G4]T : A, Self.[G4]T.[A]X == Self.[G4]T.[A]Y>
protocol G4 {
  associatedtype T : A where T : B
}