swift
swift copied to clipboard
Change objcImpl syntax to `@objc @implementation`
This PR changes the type-checking rules for objcImpl to require an @objc
attribute. It also moves the category name from the @implementation
attribute to the @objc
attribute. Backwards compatibility is maintained for the pre-stabilization @_objcImplementation
syntax.
As part of this change, plain @objc(CustomName)
on an extension
now changes its category name when it is printed through PrintAsClang
or IRGen'd; the name previously was parsed and partially validated but ignored. The only new diagnostic related to this is a warning in Swift 5 mode but will be an error in Swift 6 mode.
~~This draft currently incorporates commits from #73128 and will need to be rebased once that lands, so don't worry about the gigantic Reviewers list it has right now.~~
@swift-ci please test
@swift-ci please test
@swift-ci please test
@swift-ci Please Build Toolchain macOS Platform
@swift-ci Please Build Toolchain Linux Platform
Won't be able to build a toolchain until apple/llvm-project#8714 merges.
@swift-ci please build toolchain
Toolchains:
- macOS: https://ci.swift.org/job/swift-PR-toolchain-macos/1247/artifact/branch-main/swift-PR-73309-1247-osx.tar.gz
- Ubuntu: https://download.swift.org/tmp/pull-request/73309/820/ubuntu2004/PR-ubuntu2004.tar.gz
- Windows: https://ci-external.swift.org/job/swift-PR-build-toolchain-windows/1235/artifact/build/artifacts/
(Of course, this is only really going to work on Apple platforms, since it’s an ObjC interop feature.)
@swift-ci please test
@swift-ci please test