[Clang importer] Map swift_objc_members attribute found on superclasses.

Fixes rdar://problem/33514802.
This commit is contained in:
Doug Gregor
2017-07-25 16:18:31 -07:00
parent 8b3889a0a3
commit e82e7d5fbd
3 changed files with 24 additions and 3 deletions

View File

@@ -22,6 +22,12 @@ __attribute__((objc_root_class))
@interface Base
@end
@interface B : A
@end
@interface C : B
@end
#endif // __OBJC__
#import <APINotesFrameworkTest/Classes.h>

View File

@@ -1,4 +1,4 @@
// RUN: %target-typecheck-verify-swift -I %S/Inputs/custom-modules -F %S/Inputs/custom-frameworks
// RUN: %target-typecheck-verify-swift -I %S/Inputs/custom-modules -F %S/Inputs/custom-frameworks -swift-version 4
import APINotesTest
import APINotesFrameworkTest
@@ -7,8 +7,18 @@ extension A {
func implicitlyObjC() { }
}
extension C {
func alsoImplicitlyObjC() { }
}
class D : C {
func yetAnotherImplicitlyObjC() { }
}
func testSelectors(a: AnyObject) {
a.implicitlyObjC?() // okay: would complain without SwiftObjCMembers
a.alsoImplicitlyObjC?() // okay: would complain without SwiftObjCMembers
a.yetAnotherImplicitlyObjC?() // okay: would complain without SwiftObjCMembers
}
#endif