You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/decl/protocol/req/missing_conformance.swift
+28Lines changed: 28 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -110,3 +110,31 @@ struct S3 : P12 { // expected-error {{type 'S3' does not conform to protocol 'P1
110
110
// expected-note@-1 {{candidate can not infer 'A' = 'P11' because 'P11' is not a nominal type and so can't conform to 'P11'}}
111
111
}
112
112
113
+
// SR-12759
114
+
structCountSteps1<T>:Collection{
115
+
init(count:Int){self.count = count }
116
+
varcount:Int
117
+
118
+
varstartIndex:Int{0}
119
+
varendIndex:Int{ count }
120
+
func index(after i:Int)->Int{
121
+
totalSteps +=1 // expected-error {{cannot find 'totalSteps' in scope}}
122
+
return i +1
123
+
}
124
+
subscript(i:Int)->Int{return i }
125
+
}
126
+
127
+
extensionCountSteps1 // expected-error {{type 'CountSteps1<T>' does not conform to protocol 'RandomAccessCollection'}}
128
+
// expected-error@-1 {{conditional conformance of type 'CountSteps1<T>' to protocol 'RandomAccessCollection' does not imply conformance to inherited protocol 'BidirectionalCollection'}}
129
+
// expected-note@-2 {{did you mean to explicitly state the conformance like 'extension CountSteps1: BidirectionalCollection where ...'?}}
130
+
// expected-error@-3 {{type 'CountSteps1<T>' does not conform to protocol 'BidirectionalCollection'}}
0 commit comments