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