File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -84,3 +84,28 @@ struct UsesSameTypedDefaultWithReqts: SameTypedDefaultWithReqts {
84
84
struct UsesSameTypedDefaultWithoutSatisfyingReqts : SameTypedDefaultWithReqts {
85
85
static var y : YType { return YType ( ) }
86
86
}
87
+
88
+ protocol SameTypedDefaultBaseWithReqts {
89
+ associatedtype X : XReqt // expected-note{{}}
90
+ static var x : X { get }
91
+ }
92
+ protocol SameTypedDefaultDerivedWithReqts : SameTypedDefaultBaseWithReqts {
93
+ associatedtype Y : YReqt
94
+ static var y : Y { get }
95
+ }
96
+
97
+ extension SameTypedDefaultDerivedWithReqts where Y == X {
98
+ static var x : X {
99
+ return y
100
+ }
101
+ }
102
+
103
+ struct UsesSameTypedDefaultDerivedWithReqts : SameTypedDefaultDerivedWithReqts {
104
+ static var y : XYType { return XYType ( ) }
105
+ }
106
+
107
+ // expected-error@+1{{does not conform}}
108
+ struct UsesSameTypedDefaultDerivedWithoutSatisfyingReqts : SameTypedDefaultDerivedWithReqts {
109
+ static var y : YType { return YType ( ) }
110
+ }
111
+
You can’t perform that action at this time.
0 commit comments