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 @@ -1666,10 +1666,13 @@ visitObjCImplementationAttr(ObjCImplementationAttr *attr) {
1666
1666
// supported.
1667
1667
auto deploymentAvailability = AvailabilityContext::forDeploymentTarget (Ctx);
1668
1668
if (!deploymentAvailability.isContainedIn (Ctx.getSwift50Availability ())) {
1669
- diagnose (attr->getLocation (),
1669
+ auto diag = diagnose (attr->getLocation (),
1670
1670
diag::attr_objc_implementation_raise_minimum_deployment_target,
1671
1671
prettyPlatformString (targetPlatform (Ctx.LangOpts )),
1672
1672
Ctx.getSwift50Availability ().getOSVersion ().getLowerEndpoint ());
1673
+ if (attr->isEarlyAdopter ()) {
1674
+ diag.wrapIn (diag::wrap_objc_implementation_will_become_error);
1675
+ }
1673
1676
}
1674
1677
}
1675
1678
else if (auto AFD = dyn_cast<AbstractFunctionDecl>(D)) {
Original file line number Diff line number Diff line change 1
1
// 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
3
3
// REQUIRES: objc_interop
4
4
// REQUIRES: OS=macosx
5
5
6
- @_objcImplementation extension ObjCImplSubclass {
6
+ @objc @ implementation extension ObjCImplSubclass {
7
7
// expected-error@-1 {{'@implementation' of an Objective-C class requires a minimum deployment target of at least macOS 10.14.4}}
8
8
}
9
9
10
- @_objcImplementation ( Conformance) extension ObjCClass {
10
+ @objc ( Conformance) @ implementation extension ObjCClass {
11
11
// expected-error@-1 {{'@implementation' of an Objective-C class requires a minimum deployment target of at least macOS 10.14.4}}
12
12
func requiredMethod1( ) { }
13
13
func requiredMethod2( ) { }
14
14
}
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