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
1
+ // RUN: %target-swift-frontend -typecheck -verify %s
2
+
3
+ protocol NeedsF0 {
4
+ func f0( ) // expected-note {{protocol requires function 'f0()' with type '() -> ()'; do you want to add a stub?}}
5
+ }
6
+
7
+ struct S0 : NeedsF0 { // expected-error {{type 'S0' does not conform to protocol 'NeedsF0'}}
8
+ @_implements ( NeedsF0, f0 ( ) )
9
+ func g0( ) -> Bool { // expected-note {{candidate has non-matching type '() -> Bool'}}
10
+ return true
11
+ }
12
+
13
+ @_implements ( NeedsF0, ff0 ( ) ) // expected-error {{protocol 'NeedsF0' has no member 'ff0()'}}
14
+ func gg0( ) {
15
+ }
16
+
17
+ @_implements ( Int, zz) // expected-error {{non-protocol type in @_implements attribute}}
18
+ static func gg1( x: S0 , y: S0 ) -> Bool {
19
+ }
20
+
21
+ @_implements ( Equatable, == ( _: _: ) ) // expected-error {{containing type 'S0' does not conform to protocol 'Equatable'}}
22
+ static func gg2( x: S0 , y: S0 ) -> Bool {
23
+ }
24
+ }
25
+
You can’t perform that action at this time.
0 commit comments