@@ -81,21 +81,21 @@ enum Bar8: Foo8 {
81
81
// Witness does not have argument label, but requirement does
82
82
83
83
protocol Foo9 {
84
- static func bar( f: Int ) -> Self // expected-note {{protocol requires function 'bar(f:)' with type '(Int) -> Bar9'; do you want to add a stub? }}
84
+ static func bar( f: Int ) -> Self // expected-note {{requirement 'bar(f:)' declared here }}
85
85
}
86
86
87
- enum Bar9 : Foo9 { // expected-error {{type 'Bar9' does not conform to protocol 'Foo9'}}
88
- case bar( _ f: Int ) // expected-note {{candidate has non-matching type '(Bar9.Type) -> (Int) -> Bar9' }}
87
+ enum Bar9 : Foo9 {
88
+ case bar( _ f: Int ) // expected-error {{enum case 'bar' has different argument labels from those required by protocol 'Foo9' ('bar(f:)') }}
89
89
}
90
90
91
91
// Witness does not have any labels, but requirement does
92
92
93
93
protocol Foo10 {
94
- static func bar( g: Int ) -> Self // expected-note {{protocol requires function 'bar(g:)' with type '(Int) -> Bar10'; do you want to add a stub? }}
94
+ static func bar( g: Int ) -> Self // expected-note {{requirement 'bar(g:)' declared here }}
95
95
}
96
96
97
- enum Bar10 : Foo10 { // expected-error {{type 'Bar10' does not conform to protocol 'Foo10'}}
98
- case bar( Int ) // expected-note {{candidate has non-matching type '(Bar10.Type) -> (Int) -> Bar10' }}
97
+ enum Bar10 : Foo10 {
98
+ case bar( Int ) // expected-error {{enum case 'bar' has different argument labels from those required by protocol 'Foo10' ('bar(g:)') }}
99
99
}
100
100
101
101
// Witness does not have a payload, but requirement is a function
@@ -129,3 +129,13 @@ enum Bar13: Foo13 {
129
129
case bar( j: Int ) // Okay
130
130
case baz( _ k: String ) // Okay
131
131
}
132
+
133
+ ////// REQUIREMENT IS A THROWING FUNCTION //////
134
+
135
+ protocol ThrowingFactory {
136
+ static func horse( _: Int ) throws -> Self
137
+ }
138
+
139
+ enum HorseFactory : ThrowingFactory {
140
+ case horse( Int )
141
+ }
0 commit comments