File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -1665,10 +1665,13 @@ visitObjCImplementationAttr(ObjCImplementationAttr *attr) {
16651665 // supported.
16661666 auto deploymentAvailability = AvailabilityContext::forDeploymentTarget (Ctx);
16671667 if (!deploymentAvailability.isContainedIn (Ctx.getSwift50Availability ())) {
1668- diagnose (attr->getLocation (),
1668+ auto diag = diagnose (attr->getLocation (),
16691669 diag::attr_objc_implementation_raise_minimum_deployment_target,
16701670 prettyPlatformString (targetPlatform (Ctx.LangOpts )),
16711671 Ctx.getSwift50Availability ().getOSVersion ().getLowerEndpoint ());
1672+ if (attr->isEarlyAdopter ()) {
1673+ diag.wrapIn (diag::wrap_objc_implementation_will_become_error);
1674+ }
16721675 }
16731676 }
16741677 else if (auto AFD = dyn_cast<AbstractFunctionDecl>(D)) {
Original file line number Diff line number Diff line change 11// Hardcode x86_64 macOS because Apple Silicon was born ABI-stable
2- // RUN: %target-typecheck-verify-swift -import-objc-header %S/Inputs/objc_implementation.h -target x86_64-apple-macosx10.14.3
2+ // RUN: %target-typecheck-verify-swift -import-objc-header %S/Inputs/objc_implementation.h -target x86_64-apple-macosx10.14.3 -enable-experimental-feature ObjCImplementation
33// REQUIRES: objc_interop
44// REQUIRES: OS=macosx
55
6- @_objcImplementation extension ObjCImplSubclass {
6+ @objc @ implementation extension ObjCImplSubclass {
77 // expected-error@-1 {{'@implementation' of an Objective-C class requires a minimum deployment target of at least macOS 10.14.4}}
88}
99
10- @_objcImplementation ( Conformance) extension ObjCClass {
10+ @objc ( Conformance) @ implementation extension ObjCClass {
1111 // expected-error@-1 {{'@implementation' of an Objective-C class requires a minimum deployment target of at least macOS 10.14.4}}
1212 func requiredMethod1( ) { }
1313 func requiredMethod2( ) { }
1414}
15+
16+ @_objcImplementation ( EmptyCategory) extension ObjCClass {
17+ // expected-warning@-1 {{'@implementation' of an Objective-C class requires a minimum deployment target of at least macOS 10.14.4; this will become an error after adopting '@implementation'}}
18+ // expected-warning@-2 {{'@_objcImplementation' is deprecated; use '@implementation' instead}}
19+ }
You can’t perform that action at this time.
0 commit comments