@@ -164,6 +164,8 @@ struct SubscriptArity {
164164// Throws effect checking
165165//
166166
167+ enum MyError : Error { }
168+
167169@abi ( func throws00( _: ( ) throws -> Void) )
168170func throws00( _: ( ) throws -> Void ) { }
169171
@@ -173,6 +175,9 @@ func throws10(_: () throws -> Void) {}
173175@abi( func throw s20 ( _: ( ) throws -> Void) rethrows) // expected-error {{cannot give 'throws20' the ABI of a global function which can throw}}
174176func throw s20 ( _: ( ) throws -> Void) { }
175177
178+ @abi( func throw s30 ( _: ( ) throws -> Void) throws( MyError) ) // expected-error {{cannot give 'throws30' the ABI of a global function which can throw}}
179+ func throw s30 ( _: ( ) throws -> Void) { }
180+
176181@abi( func throw s01 ( _: ( ) throws -> Void) ) // expected-error {{cannot give 'throws01' the ABI of a global function which cannot throw}}
177182func throw s01 ( _: ( ) throws -> Void) throws { }
178183
@@ -182,6 +187,9 @@ func throws11(_: () throws -> Void) throws {}
182187@abi ( func throws21( _: ( ) throws -> Void) rethrows)
183188func throw s21 ( _: ( ) throws -> Void) throws { }
184189
190+ @abi ( func throws31( _: ( ) throws -> Void) throws( MyError) ) // expected-error {{thrown type 'MyError' in '@abi' should match 'any Error'}}
191+ func throw s31 ( _: ( ) throws -> Void) throws { } // expected-note@:37 {{should match type here}}
192+
185193@abi ( func throws02( _: ( ) throws -> Void) ) // expected-error {{cannot give 'throws02' the ABI of a global function which cannot throw}}
186194func throw s02 ( _: ( ) throws -> Void) rethrows { }
187195
@@ -191,6 +199,21 @@ func throws12(_: () throws -> Void) rethrows {}
191199@abi ( func throws22( _: ( ) throws -> Void) rethrows)
192200func throw s22 ( _: ( ) throws -> Void) rethrows { }
193201
202+ @abi ( func throws32( _: ( ) throws -> Void) throws( MyError) ) // expected-error {{thrown type 'MyError' in '@abi' should match 'any Error'}}
203+ func throw s32 ( _: ( ) throws -> Void) rethrows { } // expected-note@:37 {{should match type here}}
204+
205+ @abi ( func throws03( _: ( ) throws -> Void) ) // expected-error {{cannot give 'throws03' the ABI of a global function which cannot throw}}
206+ func throw s03 ( _: ( ) throws -> Void) throws( MyError) { }
207+
208+ @abi ( func throws13( _: ( ) throws -> Void) throws) // expected-error {{thrown type 'any Error' in '@abi' should match 'MyError'}}
209+ func throw s13 ( _: ( ) throws -> Void) throws( MyError) { } // expected-note@:37 {{should match type here}}
210+
211+ @abi ( func throws23( _: ( ) throws -> Void) rethrows) // expected-error {{thrown type 'any Error' in '@abi' should match 'MyError'}}
212+ func throw s23 ( _: ( ) throws -> Void) throws( MyError) { } // expected-note@:37 {{should match type here}}
213+
214+ @abi ( func throws33( _: ( ) throws -> Void) throws( MyError) )
215+ func throw s33 ( _: ( ) throws -> Void) throws( MyError) { }
216+
194217@abi ( var throws00Var: Int)
195218var throw s00 Var: Int { get { fatalError ( ) } }
196219
0 commit comments