@@ -1584,6 +1584,10 @@ WARNING(enum_frozen_nonpublic,none,
15841584ERROR(getset_init,none,
15851585 " variable with getter/setter cannot have an initial value" , ())
15861586
1587+ ERROR(effectful_not_representable_objc,none,
1588+ " %0 with 'throws' or 'async' is not representable in Objective-C" ,
1589+ (DescriptiveDeclKind))
1590+
15871591ERROR(unimplemented_static_var,none,
15881592 " %select{ERROR|static|class}1 stored properties not supported"
15891593 " %select{ in this context| in generic types| in classes| in protocol extensions}0"
@@ -2600,6 +2604,10 @@ ERROR(override_class_declaration_in_extension,none,
26002604ERROR(override_throws,none,
26012605 " cannot override non-throwing %select{method|initializer}0 with "
26022606 " 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))
26032611ERROR(override_throws_objc,none,
26042612 " overriding a throwing @objc %select{method|initializer}0 with "
26052613 " a non-throwing %select{method|initializer}0 is not supported" , (bool ))
@@ -4150,21 +4158,21 @@ ERROR(isa_collection_downcast_pattern_value_unimplemented,none,
41504158ERROR(try_unhandled,none,
41514159 " errors thrown from here are not handled" , ())
41524160ERROR(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 ))
41544162ERROR(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 ))
41574165ERROR(throw_in_nonthrowing_function,none,
41584166 " error is not handled because the enclosing function "
41594167 " is not declared 'throws'" , ())
41604168
41614169ERROR(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 ))
41644172ERROR(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 "
41664174 " 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 ))
41684176ERROR(throw_in_rethrows_function,none,
41694177 " a function declared 'rethrows' may only throw if its parameter does" , ())
41704178NOTE(because_rethrows_argument_throws,none,
@@ -4176,11 +4184,11 @@ NOTE(because_rethrows_conformance_throws,none,
41764184 " call is to 'rethrows' function, but a conformance has a throwing witness" , ())
41774185
41784186ERROR(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 ))
41814189ERROR(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 ))
41844192ERROR(throw_in_nonthrowing_autoclosure,none,
41854193 " error is not handled because it is thrown in a non-throwing "
41864194 " autoclosure" , ())
@@ -4189,17 +4197,17 @@ ERROR(try_unhandled_in_nonexhaustive_catch,none,
41894197 " errors thrown from here are not handled because the "
41904198 " enclosing catch is not exhaustive" , ())
41914199ERROR(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 ))
41934201ERROR(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 ))
41964204ERROR(throw_in_nonexhaustive_catch,none,
41974205 " error is not handled because the enclosing catch is not exhaustive" , ())
41984206
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 "
42014209 " %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 ))
42034211ERROR(throw_in_illegal_context,none,
42044212 " errors cannot be thrown out of "
42054213 " %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,
42134221 " call can throw but is not marked with 'try'" , ())
42144222ERROR(throwing_async_let_without_try,none,
42154223 " 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'" , ())
42164228NOTE(note_forgot_try,none,
42174229 " did you mean to use 'try'?" , ())
42184230NOTE(note_error_to_optional,none,
@@ -4382,6 +4394,9 @@ ERROR(actor_isolated_from_escaping_closure,none,
43824394ERROR(actor_isolated_keypath_component,none,
43834395 " cannot form key path to actor-isolated %0 %1" ,
43844396 (DescriptiveDeclKind, DeclName))
4397+ ERROR(effectful_keypath_component,none,
4398+ " cannot form key path to %0 with 'throws' or 'async'" ,
4399+ (DescriptiveDeclKind))
43854400ERROR(local_function_executed_concurrently,none,
43864401 " concurrently-executed %0 %1 must be marked as '@Sendable'" ,
43874402 (DescriptiveDeclKind, DeclName))
@@ -5615,6 +5630,9 @@ ERROR(property_wrapper_let, none,
56155630ERROR(property_wrapper_computed, none,
56165631 " property wrapper cannot be applied to a computed property" ,
56175632 ())
5633+ ERROR(property_wrapper_effectful,none,
5634+ " property wrappers currently cannot define an 'async' or 'throws' accessor" ,
5635+ ())
56185636
56195637ERROR(property_with_wrapper_conflict_attribute,none,
56205638 " property %0 with a wrapper cannot also be "
0 commit comments