Sema: Differentiate between 'class is @objc' and 'class has implicitly @objc members'

Generic subclasses of @objc classes are thus no longer @objc, but still
have implicitly @objc members.

Explicit @objc on generic classes or classes that inherit from @objc
classes is now forbidden with a diagnostic. Users need to know that
while they can override Objective-C methods and properties in such
a class, they cannot refer to the class by name from Objective-C code,
since it will not appear in the bridging header.

Fixes <rdar://problem/21342574>.

Swift SVN r30494
This commit is contained in:
Slava Pestov
2015-07-22 06:34:20 +00:00
parent 3175c90eac
commit 871d71a555
12 changed files with 136 additions and 34 deletions

View File

@@ -2296,7 +2296,7 @@ void TypeChecker::addImplicitDestructor(ClassDecl *CD) {
DD->setImplicit();
// Type-check the constructor declaration.
// Type-check the destructor declaration.
typeCheckDecl(DD, /*isFirstPass=*/true);
// Create an empty body for the destructor.