@@ -208,68 +208,6 @@ extension GenericStruct where Param: InternalProto {
208
208
}
209
209
210
210
211
- public protocol ProtoWithReqs {
212
- associatedtype Assoc
213
- func foo( )
214
- }
215
-
216
- public struct Adopter < T> : ProtoWithReqs { }
217
- // expected-error@-1 {{method 'foo()' must be declared public because it matches a requirement in public protocol 'ProtoWithReqs'}} {{none}}
218
- // expected-error@-2 {{type alias 'Assoc' must be declared public because it matches a requirement in public protocol 'ProtoWithReqs'}} {{none}}
219
- extension Adopter {
220
- typealias Assoc = Int
221
- // expected-note@-1 {{mark the type alias as 'public' to satisfy the requirement}} {{3-3=public }}
222
- func foo( ) { }
223
- // expected-note@-1 {{mark the instance method as 'public' to satisfy the requirement}} {{3-3=public }}
224
- }
225
-
226
- public class AnotherAdopterBase {
227
- typealias Assoc = Int
228
- // expected-note@-1 {{mark the type alias as 'public' to satisfy the requirement}} {{3-3=public }}
229
- func foo( ) { }
230
- // expected-note@-1 {{mark the instance method as 'public' to satisfy the requirement}} {{3-3=public }}
231
- }
232
- public class AnotherAdopterSub : AnotherAdopterBase , ProtoWithReqs { }
233
- // expected-error@-1 {{method 'foo()' must be declared public because it matches a requirement in public protocol 'ProtoWithReqs'}} {{none}}
234
- // expected-error@-2 {{type alias 'Assoc' must be declared public because it matches a requirement in public protocol 'ProtoWithReqs'}} {{none}}
235
-
236
- public protocol ReqProvider { }
237
- extension ReqProvider {
238
- func foo( ) { }
239
- // expected-note@-1 {{mark the instance method as 'public' to satisfy the requirement}} {{3-3=public }}
240
- }
241
- public struct AdoptViaProtocol : ProtoWithReqs , ReqProvider {
242
- // expected-error@-1 {{method 'foo()' must be declared public because it matches a requirement in public protocol 'ProtoWithReqs'}} {{none}}
243
- public typealias Assoc = Int
244
- }
245
-
246
- public protocol ReqProvider2 { }
247
- extension ProtoWithReqs where Self : ReqProvider2 {
248
- func foo( ) { }
249
- // expected-note@-1 {{mark the instance method as 'public' to satisfy the requirement}} {{3-3=public }}
250
- }
251
- public struct AdoptViaCombinedProtocol : ProtoWithReqs , ReqProvider2 {
252
- // expected-error@-1 {{method 'foo()' must be declared public because it matches a requirement in public protocol 'ProtoWithReqs'}} {{none}}
253
- public typealias Assoc = Int
254
- }
255
-
256
- public protocol PublicInitProto {
257
- var value : Int { get }
258
- init ( value: Int )
259
- }
260
- public struct NonPublicInitStruct : PublicInitProto {
261
- public var value : Int
262
- init ( value: Int ) {
263
- // expected-error@-1 {{initializer 'init(value:)' must be declared public because it matches a requirement in public protocol 'PublicInitProto'}}
264
- // expected-note@-2 {{mark the initializer as 'public' to satisfy the requirement}}
265
- self . value = value
266
- }
267
- }
268
- public struct NonPublicMemberwiseInitStruct : PublicInitProto {
269
- // expected-error@-1 {{initializer 'init(value:)' must be declared public because it matches a requirement in public protocol 'PublicInitProto'}}
270
- public var value : Int
271
- }
272
-
273
211
public class OuterClass {
274
212
class InnerClass { }
275
213
}
0 commit comments