mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Fix @objc use in module interfaces for objcImpl
objcImpl extensions with final public members need to be printed into module interfaces, but with the @implementation attribute suppressed. That worked fine…but when we switched to the new syntax, we should also have suppressed the @objc attribute, and we mistakenly did not. Correct this oversight. Fixes rdar://129178360.
This commit is contained in:
@@ -1326,6 +1326,14 @@ void PrintAST::printAttributes(const Decl *D) {
|
||||
}
|
||||
}
|
||||
|
||||
// If we are suppressing @implementation, also suppress @objc on extensions.
|
||||
if (auto ED = dyn_cast<ExtensionDecl>(D)) {
|
||||
if (ED->isObjCImplementation() &&
|
||||
Options.excludeAttrKind(DeclAttrKind::ObjCImplementation)) {
|
||||
Options.ExcludeAttrList.push_back(DeclAttrKind::ObjC);
|
||||
}
|
||||
}
|
||||
|
||||
// We will handle ownership specifiers separately.
|
||||
if (isa<FuncDecl>(D)) {
|
||||
Options.ExcludeAttrList.push_back(DeclAttrKind::Mutating);
|
||||
|
||||
@@ -16,6 +16,10 @@ import Foundation
|
||||
|
||||
// We should never see @_objcImplementation in the header
|
||||
// NEGATIVE-NOT: @_objcImplementation
|
||||
// NEGATIVE-NOT: @implementation
|
||||
|
||||
// @objc should be omitted on extensions
|
||||
// NEGATIVE-NOT: @objc{{.*}} extension
|
||||
|
||||
//
|
||||
// @_objcImplementation class
|
||||
|
||||
Reference in New Issue
Block a user