@@ -1584,6 +1584,10 @@ WARNING(enum_frozen_nonpublic,none,
1584
1584
ERROR(getset_init,none,
1585
1585
" variable with getter/setter cannot have an initial value" , ())
1586
1586
1587
+ ERROR(effectful_not_representable_objc,none,
1588
+ " %0 with 'throws' or 'async' is not representable in Objective-C" ,
1589
+ (DescriptiveDeclKind))
1590
+
1587
1591
ERROR(unimplemented_static_var,none,
1588
1592
" %select{ERROR|static|class}1 stored properties not supported"
1589
1593
" %select{ in this context| in generic types| in classes| in protocol extensions}0"
@@ -2600,6 +2604,10 @@ ERROR(override_class_declaration_in_extension,none,
2600
2604
ERROR(override_throws,none,
2601
2605
" cannot override non-throwing %select{method|initializer}0 with "
2602
2606
" throwing %select{method|initializer}0" , (bool ))
2607
+ // TODO: this really could be merged with the above.
2608
+ ERROR(override_with_more_effects,none,
2609
+ " cannot override non-'%1' %0 with '%1' %0" ,
2610
+ (DescriptiveDeclKind, StringRef))
2603
2611
ERROR(override_throws_objc,none,
2604
2612
" overriding a throwing @objc %select{method|initializer}0 with "
2605
2613
" a non-throwing %select{method|initializer}0 is not supported" , (bool ))
@@ -4150,21 +4158,21 @@ ERROR(isa_collection_downcast_pattern_value_unimplemented,none,
4150
4158
ERROR(try_unhandled,none,
4151
4159
" errors thrown from here are not handled" , ())
4152
4160
ERROR(throwing_call_unhandled,none,
4153
- " call can throw, but the error is not handled" , ())
4161
+ " %0 can throw, but the error is not handled" , (StringRef ))
4154
4162
ERROR(tryless_throwing_call_unhandled,none,
4155
- " call can throw, but it is not marked with 'try' and "
4156
- " the error is not handled" , ())
4163
+ " %0 can throw, but it is not marked with 'try' and "
4164
+ " the error is not handled" , (StringRef ))
4157
4165
ERROR(throw_in_nonthrowing_function,none,
4158
4166
" error is not handled because the enclosing function "
4159
4167
" is not declared 'throws'" , ())
4160
4168
4161
4169
ERROR(throwing_call_in_rethrows_function,none,
4162
- " call can throw, but the error is not handled; a function declared "
4163
- " 'rethrows' may only throw if its parameter does" , ())
4170
+ " %0 can throw, but the error is not handled; a function declared "
4171
+ " 'rethrows' may only throw if its parameter does" , (StringRef ))
4164
4172
ERROR(tryless_throwing_call_in_rethrows_function,none,
4165
- " call can throw, but it is not marked with 'try' and "
4173
+ " %0 can throw, but it is not marked with 'try' and "
4166
4174
" the error is not handled; a function declared "
4167
- " 'rethrows' may only throw if its parameter does" , ())
4175
+ " 'rethrows' may only throw if its parameter does" , (StringRef ))
4168
4176
ERROR(throw_in_rethrows_function,none,
4169
4177
" a function declared 'rethrows' may only throw if its parameter does" , ())
4170
4178
NOTE(because_rethrows_argument_throws,none,
@@ -4176,11 +4184,11 @@ NOTE(because_rethrows_conformance_throws,none,
4176
4184
" call is to 'rethrows' function, but a conformance has a throwing witness" , ())
4177
4185
4178
4186
ERROR(throwing_call_in_nonthrowing_autoclosure,none,
4179
- " call can throw, but it is executed in a non-throwing "
4180
- " autoclosure" ,())
4187
+ " %0 can throw, but it is executed in a non-throwing "
4188
+ " autoclosure" ,(StringRef ))
4181
4189
ERROR(tryless_throwing_call_in_nonthrowing_autoclosure,none,
4182
- " call can throw, but it is not marked with 'try' and "
4183
- " it is executed in a non-throwing autoclosure" ,())
4190
+ " %0 can throw, but it is not marked with 'try' and "
4191
+ " it is executed in a non-throwing autoclosure" ,(StringRef ))
4184
4192
ERROR(throw_in_nonthrowing_autoclosure,none,
4185
4193
" error is not handled because it is thrown in a non-throwing "
4186
4194
" autoclosure" , ())
@@ -4189,17 +4197,17 @@ ERROR(try_unhandled_in_nonexhaustive_catch,none,
4189
4197
" errors thrown from here are not handled because the "
4190
4198
" enclosing catch is not exhaustive" , ())
4191
4199
ERROR(throwing_call_in_nonexhaustive_catch,none,
4192
- " call can throw, but the enclosing catch is not exhaustive" , ())
4200
+ " %0 can throw, but the enclosing catch is not exhaustive" , (StringRef ))
4193
4201
ERROR(tryless_throwing_call_in_nonexhaustive_catch,none,
4194
- " call can throw, but it is not marked with 'try' and "
4195
- " the enclosing catch is not exhaustive" , ())
4202
+ " %0 can throw, but it is not marked with 'try' and "
4203
+ " the enclosing catch is not exhaustive" , (StringRef ))
4196
4204
ERROR(throw_in_nonexhaustive_catch,none,
4197
4205
" error is not handled because the enclosing catch is not exhaustive" , ())
4198
4206
4199
- ERROR(throwing_call_in_illegal_context ,none,
4200
- " call can throw, but errors cannot be thrown out of "
4207
+ ERROR(throwing_op_in_illegal_context ,none,
4208
+ " %1 can throw, but errors cannot be thrown out of "
4201
4209
" %select{<<ERROR>>|a default argument|a property wrapper initializer|a property initializer|a global variable initializer|an enum case raw value|a catch pattern|a catch guard expression|a defer body}0" ,
4202
- (unsigned ))
4210
+ (unsigned , StringRef ))
4203
4211
ERROR(throw_in_illegal_context,none,
4204
4212
" errors cannot be thrown out of "
4205
4213
" %select{<<ERROR>>|a default argument|a property wrapper initializer|a property initializer|a global variable initializer|an enum case raw value|a catch pattern|a catch guard expression|a defer body}0" ,
@@ -4213,6 +4221,10 @@ ERROR(throwing_call_without_try,none,
4213
4221
" call can throw but is not marked with 'try'" , ())
4214
4222
ERROR(throwing_async_let_without_try,none,
4215
4223
" reading 'async let' can throw but is not marked with 'try'" , ())
4224
+ ERROR(throwing_prop_access_without_try,none,
4225
+ " property access can throw but is not marked with 'try'" , ())
4226
+ ERROR(throwing_subscript_access_without_try,none,
4227
+ " subscript access can throw but is not marked with 'try'" , ())
4216
4228
NOTE(note_forgot_try,none,
4217
4229
" did you mean to use 'try'?" , ())
4218
4230
NOTE(note_error_to_optional,none,
@@ -4382,6 +4394,9 @@ ERROR(actor_isolated_from_escaping_closure,none,
4382
4394
ERROR(actor_isolated_keypath_component,none,
4383
4395
" cannot form key path to actor-isolated %0 %1" ,
4384
4396
(DescriptiveDeclKind, DeclName))
4397
+ ERROR(effectful_keypath_component,none,
4398
+ " cannot form key path to %0 with 'throws' or 'async'" ,
4399
+ (DescriptiveDeclKind))
4385
4400
ERROR(local_function_executed_concurrently,none,
4386
4401
" concurrently-executed %0 %1 must be marked as '@Sendable'" ,
4387
4402
(DescriptiveDeclKind, DeclName))
@@ -5615,6 +5630,9 @@ ERROR(property_wrapper_let, none,
5615
5630
ERROR(property_wrapper_computed, none,
5616
5631
" property wrapper cannot be applied to a computed property" ,
5617
5632
())
5633
+ ERROR(property_wrapper_effectful,none,
5634
+ " property wrappers currently cannot define an 'async' or 'throws' accessor" ,
5635
+ ())
5618
5636
5619
5637
ERROR(property_with_wrapper_conflict_attribute,none,
5620
5638
" property %0 with a wrapper cannot also be "
0 commit comments