Skip to content

Conversation

@beccadax
Copy link
Contributor

@_objcImplementation doesn't support two kinds of Objective-C classes:

  • Root classes: SILGen doesn't know how to generate code for an Objective-C class with no superclass. And even if it could, ClangImporter doesn't import some of the primitive methods, like -retain and -release, needed to implement a root class.
  • Generic classes: Lightweight generics import awkwardly enough that it's actually quite difficult to write extension methods on them. We're declaring them out of scope to avoid these complications.

Diagnose attempts to use the attribute on classes of these kinds.

Fixes rdar://109130979&116066409.

@objcImpl, like @objc, cannot be used to implement root classes. Diagnose an attempt to do so.

Fixes rdar://109130979.
Extensions to lightweight generic classes are such a huge mess that we’re just removing these from the feature’s scope for now.

Fixes rdar://116066409.
@beccadax
Copy link
Contributor Author

@swift-ci please test

@beccadax beccadax merged commit 50a98d3 into swiftlang:main Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants