mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
NFC: Add a test that exercises subclassing an Obj-C subclass of NSObject and verifies the printed members of the Swift subclass when emitting a module interface for a module containing the Swift subclass. Also verifies that NS_SWIFT_UNAVAILABLE initializers are omitted from the emitted interface.
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface FrameworkObject : NSObject
|
||||
- (nonnull instancetype)initWithInvocation:(nullable NSInvocation *)invocation NS_SWIFT_UNAVAILABLE("unavailable");
|
||||
- (nonnull instancetype)initWithSelector:(nonnull SEL)selector;
|
||||
- (nonnull instancetype)initWithInteger:(NSInteger)integer;
|
||||
@end
|
||||
@@ -0,0 +1,4 @@
|
||||
module InheritedObjCInits {
|
||||
header "InheritedObjCInits.h"
|
||||
export *
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// RUN: %target-swift-emit-module-interface(%t.swiftinterface) %s -I %S/Inputs/inherited-objc-initializers/
|
||||
// RUN: %target-swift-typecheck-module-from-interface(%t.swiftinterface) -I %S/Inputs/inherited-objc-initializers/
|
||||
// RUN: %FileCheck %s < %t.swiftinterface
|
||||
|
||||
// REQUIRES: objc_interop
|
||||
|
||||
import InheritedObjCInits
|
||||
|
||||
// CHECK: @objc @_inheritsConvenienceInitializers public class Subclass : InheritedObjCInits.FrameworkObject {
|
||||
public class Subclass: FrameworkObject {
|
||||
// CHECK-NEXT: @objc override dynamic public init(selector: ObjectiveC.Selector)
|
||||
// CHECK-NEXT: @objc override dynamic public init(integer: Swift.Int)
|
||||
// CHECK-NEXT: @objc override dynamic public init()
|
||||
// CHECK-NEXT: @objc deinit
|
||||
} // CHECK-NEXT:{{^}$}}
|
||||
Reference in New Issue
Block a user