@@ -8276,16 +8276,16 @@ ERROR(attr_abi_mismatched_kind,none,
8276
8276
8277
8277
ERROR(attr_abi_mismatched_arity,none,
8278
8278
" cannot give %kind0 the ABI of a %kindonly0 with a different number of "
8279
- " low-level parameters " ,
8280
- (ValueDecl * ))
8279
+ " %select{|generic }1parameters " ,
8280
+ (Decl *, /* genericParams= */ bool ))
8281
8281
8282
8282
ERROR(attr_abi_mismatched_throws,none,
8283
8283
" cannot give %0 the ABI of a %kindonly0 which %select{cannot|can}1 throw" ,
8284
- (ValueDecl *, /* abiCanThrow=*/ bool ))
8284
+ (Decl *, /* abiCanThrow=*/ bool ))
8285
8285
8286
8286
ERROR(attr_abi_mismatched_async,none,
8287
8287
" cannot give %0 the ABI of %select{a non-async|an async}1 %kindonly0" ,
8288
- (ValueDecl *, /* abiIsAsync=*/ bool ))
8288
+ (Decl *, /* abiIsAsync=*/ bool ))
8289
8289
8290
8290
ERROR(attr_abi_mismatched_pbd_size,none,
8291
8291
" cannot give pattern binding the ABI of a binding with "
@@ -8294,13 +8294,86 @@ ERROR(attr_abi_mismatched_pbd_size,none,
8294
8294
8295
8295
ERROR(attr_abi_mismatched_var,none,
8296
8296
" no match for %select{%kind0 in the ABI|ABI %kind0}1" ,
8297
- (ValueDecl *, /* isABI=*/ bool ))
8297
+ (Decl *, /* isABI=*/ bool ))
8298
8298
8299
8299
ERROR(attr_abi_incompatible_with_silgen_name,none,
8300
8300
" cannot use '@_silgen_name' and '@abi' on the same %0 because they serve "
8301
8301
" the same purpose" ,
8302
8302
(DescriptiveDeclKind))
8303
8303
8304
+ ERROR(attr_abi_missing_attr,none,
8305
+ " missing '%0' %select{attribute|modifier}1 in '@abi'" ,
8306
+ (StringRef, bool ))
8307
+ ERROR(attr_abi_extra_attr,none,
8308
+ " extra %select{|implicit }2'%0' %select{attribute|modifier}1 in '@abi'" ,
8309
+ (StringRef, bool , /* isImplicit=*/ bool ))
8310
+ ERROR(attr_abi_forbidden_attr,none,
8311
+ " unused '%0' %select{attribute|modifier}1 in '@abi'" ,
8312
+ (StringRef, bool ))
8313
+ REMARK(abi_attr_inferred_attribute,none,
8314
+ " inferred '%0' in '@abi' to match %select{attribute|modifier}1 on API" ,
8315
+ (StringRef, bool ))
8316
+
8317
+ ERROR(attr_abi_mismatched_attr,none,
8318
+ " '%0' %select{attribute|modifier}1 in '@abi' should match '%2'" ,
8319
+ (StringRef, bool , StringRef))
8320
+ NOTE(attr_abi_matching_attr_here,none,
8321
+ " %select{should match|matches}0 %select{attribute|modifier}1 "
8322
+ " %select{|implicitly added }2here" ,
8323
+ (/* matches=*/ bool , /* isModifier=*/ bool , /* isImplicit=*/ bool ))
8324
+
8325
+ ERROR(attr_abi_mismatched_type,none,
8326
+ " type %0 in '@abi' should match %1" ,
8327
+ (Type, Type))
8328
+ NOTE(attr_abi_should_match_type_here,none,
8329
+ " should match type here" , ())
8330
+
8331
+ ERROR(attr_abi_mismatched_generic_signature,none,
8332
+ " generic signature '%0' in '@abi' is not compatible with '%1'" ,
8333
+ (StringRef, StringRef))
8334
+ ERROR(attr_abi_missing_generic_signature,none,
8335
+ " declaration in '@abi' should have generic signature compatible with "
8336
+ " '%0'" ,
8337
+ (StringRef))
8338
+ ERROR(attr_abi_extra_generic_signature,none,
8339
+ " declaration in '@abi' should not have generic signature because %0 "
8340
+ " is not generic" ,
8341
+ (Decl *))
8342
+
8343
+ ERROR(attr_abi_mismatched_param_modifier,none,
8344
+ " %select{default |}0%3 %select{attribute|modifier}2 "
8345
+ " %select{|'%0' }0in '@abi' is not compatible with %select{default|'%1'}1" ,
8346
+ (StringRef, StringRef, /* isModifier=*/ bool , DescriptiveDeclKind))
8347
+ ERROR(attr_abi_no_default_arguments,none,
8348
+ " %kind0 in '@abi' should not have a default argument; it does not "
8349
+ " affect the parameter's ABI" ,
8350
+ (Decl *))
8351
+
8352
+ // These macros insert 'final', 'non-final', or nothing depending on both the
8353
+ // current decl and its counterpart, such that 'non-final' is used if the
8354
+ // counterpart would be described as 'final' or 'static'. They must be kept in
8355
+ // sync with `StaticnessAndFinality`.
8356
+ #define NONFINAL_OR_NOTHING (COUNTERPART ) \
8357
+ " %select{||non-final |non-final |non-final |%error}" #COUNTERPART
8358
+ #define FINAL_OR_NONFINAL_OR_NOTHING (CURRENT, COUNTERPART, FINAL_OK ) \
8359
+ " %select{|%select{" NONFINAL_OR_NOTHING(COUNTERPART) \
8360
+ "|" NONFINAL_OR_NOTHING(COUNTERPART) \
8361
+ "|final |final ||%error}" #CURRENT " }" #FINAL_OK
8362
+
8363
+ ERROR(attr_abi_static_final_mismatch,none,
8364
+ FINAL_OR_NONFINAL_OR_NOTHING(0, 2, 4) " %kind1 in ' @abi' should be "
8365
+ FINAL_OR_NONFINAL_OR_NOTHING(2, 0, 4) " %kindonly3 to ensure ABI "
8366
+ " compatibility" ,
8367
+ (uint8_t, Decl *, uint8_t, Decl *, /*isClass=*/bool))
8368
+
8369
+ #undef NONFINAL_OR_NOTHING
8370
+ #undef FINAL_OR_NONFINAL_OR_NOTHING
8371
+
8372
+ ERROR(attr_abi_failable_mismatch,none,
8373
+ " cannot give %select{non-failable|failable}1 %kind0 the ABI of a "
8374
+ " %select{non-failable|failable}2 %kindonly0" ,
8375
+ (Decl *, bool, bool))
8376
+
8304
8377
//===----------------------------------------------------------------------===//
8305
8378
// MARK: Isolated conformances
8306
8379
//===----------------------------------------------------------------------===//
0 commit comments