We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0ebe9a1 commit e35a068Copy full SHA for e35a068
validation-test/compiler_crashers_2_fixed/sr11392.swift
@@ -0,0 +1,28 @@
1
+// RUN: %target-swift-frontend -verify -emit-ir %s
2
+
3
+// Ideally this would type check successfully; we should be able to
4
+// infer that X == Int using the same-type constraint 'A.X == X'.
5
6
+protocol P1 {
7
+ associatedtype X
8
+ // expected-note@-1 {{protocol requires nested type 'X'; do you want to add it?}}
9
+ associatedtype A: P2 where A.X == X
10
+}
11
12
+protocol P2 {
13
14
15
16
+struct S {}
17
18
+extension S {
19
+ struct A: P2 {
20
+ typealias X = Int
21
+ }
22
23
24
25
+extension S: P1 {}
26
+// expected-error@-1 {{type 'S' does not conform to protocol 'P1'}}
27
28
+print(S.X.self)
0 commit comments