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: branches/master-rebranch/test/decl/protocol/req/witness_fix_its.swift
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@ protocol Foo {
11
11
staticpostfixfunc^^^^(value:Self)->Int // expected-note {{protocol requires function '^^^^' with type '(ConformsToFoo) -> Int'; do you want to add a stub?}}
12
12
func bar4(closure:()throws->Int)rethrows // expected-note {{protocol requires function 'bar4(closure:)' with type '(() throws -> Int) throws -> ()'; do you want to add a stub?}}
13
13
varbar5:Int{getset} // expected-note {{protocol requires property 'bar5' with type 'Int'; do you want to add a stub?}}
14
+
static subscript(_ pos:Int)->Int{get} // expected-note {{protocol requires subscript with type '(Int) -> Int'; do you want to add a stub?}}
14
15
}
15
16
16
17
structConformsToFoo:Foo{ // expected-error {{type 'ConformsToFoo' does not conform to protocol 'Foo'}}
@@ -23,4 +24,5 @@ struct ConformsToFoo: Foo { // expected-error {{type 'ConformsToFoo' does not co
23
24
// expected-note@-1 {{candidate is prefix, not postfix as required}}{{10-16=postfix}}
24
25
func bar4(closure:()throws->Int)throws{} // expected-note {{candidate is not 'rethrows', but protocol requires it}}{{40-46=rethrows}}
25
26
varbar5:Int{return0} // expected-note {{candidate is not settable, but protocol requires it}}{{none}}
27
+
subscript(_ pos:Int)->Int{return0} // expected-note {{candidate operates on an instance, not a type as required}}{{3-3=static}}
0 commit comments