swift icon indicating copy to clipboard operation
swift copied to clipboard

Change objcImpl syntax to `@objc @implementation`

Open beccadax opened this issue 10 months ago • 3 comments

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.~~

beccadax avatar Apr 27 '24 01:04 beccadax

@swift-ci please test

beccadax avatar Apr 27 '24 01:04 beccadax

@swift-ci please test

beccadax avatar May 02 '24 00:05 beccadax

@swift-ci please test

beccadax avatar May 03 '24 19:05 beccadax

@swift-ci Please Build Toolchain macOS Platform

beccadax avatar May 07 '24 20:05 beccadax

@swift-ci Please Build Toolchain Linux Platform

beccadax avatar May 07 '24 20:05 beccadax

Won't be able to build a toolchain until apple/llvm-project#8714 merges.

beccadax avatar May 08 '24 00:05 beccadax

@swift-ci please build toolchain

beccadax avatar May 08 '24 04:05 beccadax

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.)

beccadax avatar May 08 '24 18:05 beccadax

@swift-ci please test

beccadax avatar May 17 '24 04:05 beccadax

@swift-ci please test

beccadax avatar May 17 '24 21:05 beccadax