File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change
1
+ // RUN: %target-typecheck-verify-swift %s
2
+
3
+ protocol P < T> {
4
+ associatedtype T
5
+ }
6
+
7
+ extension P {
8
+ typealias A = Int
9
+ // expected-note@-1 3{{consider moving 'A' into the definition of protocol 'P'}}
10
+ }
11
+
12
+ protocol Q {
13
+ associatedtype T : P
14
+ associatedtype U : P < T . A >
15
+ // expected-error@-1 {{'A' was defined in extension of protocol 'P' and cannot be referenced from a associated type inheritance clause}}
16
+ }
17
+
18
+ struct S < T: P , U: P < T . A > > {
19
+ // expected-error@-1 {{'A' was defined in extension of protocol 'P' and cannot be referenced from a generic parameter inheritance clause}}
20
+
21
+ func f< V> ( _: V ) where V == T . A { }
22
+ // expected-error@-1 {{'A' was defined in extension of protocol 'P' and cannot be referenced from a 'where' clause}}
23
+ }
You can’t perform that action at this time.
0 commit comments