@@ -763,6 +763,9 @@ ERROR(expr_selector_not_objc,none,
763763NOTE(make_decl_objc,none,
764764 " add '@objc' to expose this %0 to Objective-C" ,
765765 (DescriptiveDeclKind))
766+ NOTE(make_decl_objc_for_implementation,none,
767+ " add '@objc' to implement an Objective-C %0" ,
768+ (DescriptiveDeclKind))
766769
767770// Selectors-as-string-literals.
768771WARNING(selector_literal_invalid,none,
@@ -1760,21 +1763,17 @@ WARNING(objc_implementation_early_spelling_deprecated,none,
17601763ERROR(attr_objc_implementation_must_be_unconditional,none,
17611764 " only unconditional extensions can implement an Objective-C '@interface'" ,
17621765 ())
1763- ERROR(attr_objc_implementation_must_extend_class,none,
1764- " cannot mark extension of %kind0 with '@_objcImplementation'; it is not "
1765- " an imported Objective-C class" ,
1766- (ValueDecl *))
17671766ERROR(attr_objc_implementation_must_be_imported,none,
1768- " '@_objcImplementation ' cannot be used to extend %kind0 because it was "
1767+ " '@objc @implementation ' cannot be used to extend %kind0 because it was "
17691768 " defined by a Swift 'class' declaration, not an imported Objective-C "
17701769 " '@interface' declaration" ,
17711770 (ValueDecl *))
17721771ERROR(attr_objc_implementation_must_have_super,none,
1773- " '@_objcImplementation ' cannot be used to implement root %kind0; declare "
1774- " its superclass in the header" ,
1772+ " '@objc @implementation ' cannot be used to implement root %kind0; "
1773+ " declare its superclass in the header" ,
17751774 (ValueDecl *))
17761775ERROR(objc_implementation_cannot_have_generics,none,
1777- " '@_objcImplementation ' cannot be used to implement %kind0" ,
1776+ " '@objc @implementation ' cannot be used to implement %kind0" ,
17781777 (ValueDecl *))
17791778ERROR(attr_objc_implementation_category_not_found,none,
17801779 " could not find category %0 on Objective-C class %1; make sure your "
@@ -1792,10 +1791,22 @@ ERROR(attr_objc_implementation_no_category_for_func,none,
17921791 " name from this attribute" ,
17931792 (ValueDecl*))
17941793ERROR(attr_objc_implementation_no_conformance,none,
1795- " '@_objcImplementation ' extension cannot add conformance to %0; "
1794+ " '@objc @implementation ' extension cannot add conformance to %0; "
17961795 " add this conformance %select{with an ordinary extension|"
17971796 " in the Objective-C header}1" ,
17981797 (Type, bool ))
1798+ ERROR(attr_objc_implementation_raise_minimum_deployment_target,none,
1799+ " '@implementation' of an Objective-C class requires a minimum deployment "
1800+ " target of at least %0 %1" ,
1801+ (StringRef, llvm::VersionTuple))
1802+ ERROR(attr_implementation_requires_language,none,
1803+ " '@implementation' used without specifying the language being "
1804+ " implemented" ,
1805+ ())
1806+ ERROR(attr_implementation_category_goes_on_objc_attr,none,
1807+ " Objective-C category should be specified on '@objc', not "
1808+ " '@implementation'" ,
1809+ ())
17991810
18001811ERROR(member_of_objc_implementation_not_objc_or_final,none,
18011812 " %kind0 does not match any %kindonly0 declared in the headers for %1; "
@@ -1908,7 +1919,7 @@ NOTE(objc_implementation_requirement_here,none,
19081919 (ValueDecl *))
19091920
19101921ERROR(objc_implementation_init_must_be_convenience, none,
1911- " %kind0 is not valid in an '@_objcImplementation ' extension because "
1922+ " %kind0 is not valid in an '@objc @implementation ' extension because "
19121923 " Objective-C subclasses must be able to override "
19131924 " %select{designated|required}1 initializers" ,
19141925 (const ValueDecl *, /* isRequired=*/ bool ))
@@ -1922,7 +1933,7 @@ NOTE(objc_implementation_init_turn_required_to_convenience, none,
19221933
19231934// Fallback diagnostic; super-general by nature.
19241935ERROR(objc_implementation_member_requires_vtable, none,
1925- " %kind0 is not valid in an '@_objcImplementation ' extension because it "
1936+ " %kind0 is not valid in an '@objc @implementation ' extension because it "
19261937 " is an overridable Swift-only %kindonly0" ,
19271938 (const ValueDecl *))
19281939
@@ -6293,7 +6304,7 @@ ERROR(objc_extension_not_class,none,
62936304 " '@objc' can only be applied to an extension of a class" , ())
62946305
62956306// If you change this, also change enum ObjCReason
6296- #define OBJC_ATTR_SELECT " select{marked @_cdecl|marked dynamic|marked @objc|marked @objcMembers|marked @IBOutlet|marked @IBAction|marked @IBSegueAction|marked @NSManaged|a member of an @objc protocol|implicitly @objc|an @objc override|an implementation of an @objc requirement|marked @IBInspectable|marked @GKInspectable|in an @objc extension of a class (without @nonobjc)|in an @_objcImplementation extension of a class (without final or @nonobjc)|marked @objc by an access note}"
6307+ #define OBJC_ATTR_SELECT " select{marked @_cdecl|marked dynamic|marked @objc|marked @objcMembers|marked @IBOutlet|marked @IBAction|marked @IBSegueAction|marked @NSManaged|a member of an @objc protocol|implicitly @objc|an @objc override|an implementation of an @objc requirement|marked @IBInspectable|marked @GKInspectable|in an @objc extension of a class (without @nonobjc)|in an @objc @implementation extension of a class (without final or @nonobjc)|marked @objc by an access note}"
62976308
62986309ERROR (objc_invalid_on_var,none,
62996310 " property cannot be %" OBJC_ATTR_SELECT " 0 "
@@ -6448,6 +6459,12 @@ ERROR(objc_redecl_same,none,
64486459 " previous declaration with the same Objective-C selector" ,
64496460 (unsigned , DeclName, unsigned , DeclName, ObjCSelector))
64506461
6462+ ERROR(objc_redecl_category_name,none,
6463+ " %select{|imported }0extension with Objective-C category name %2 "
6464+ " conflicts with previous %select{|imported }1extension with the same "
6465+ " category name" ,
6466+ (bool , bool , Identifier))
6467+
64516468ERROR(objc_override_other,none,
64526469 OBJC_DIAG_SELECT " with Objective-C selector %4 conflicts with "
64536470 OBJC_DIAG_SELECT_2 " from superclass %5 with the same Objective-C "
0 commit comments