Skip to content

Commit 23e1773

Browse files
authored
Merge pull request #42461 from tshortli/module-interface-inherited-objc-superclass-initializers
NFC: Test emitted interface for module containing subclass of an Obj-C class with an `NS_SWIFT_UNAVAILABLE` initializer
2 parents 5be506e + a074d1e commit 23e1773

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#import <Foundation/Foundation.h>
2+
3+
@interface FrameworkObject : NSObject
4+
- (nonnull instancetype)initWithInvocation:(nullable NSInvocation *)invocation NS_SWIFT_UNAVAILABLE("unavailable");
5+
- (nonnull instancetype)initWithSelector:(nonnull SEL)selector;
6+
- (nonnull instancetype)initWithInteger:(NSInteger)integer;
7+
@end
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module InheritedObjCInits {
2+
header "InheritedObjCInits.h"
3+
export *
4+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// RUN: %target-swift-emit-module-interface(%t.swiftinterface) %s -I %S/Inputs/inherited-objc-initializers/
2+
// RUN: %target-swift-typecheck-module-from-interface(%t.swiftinterface) -I %S/Inputs/inherited-objc-initializers/
3+
// RUN: %FileCheck %s < %t.swiftinterface
4+
5+
// REQUIRES: objc_interop
6+
7+
import InheritedObjCInits
8+
9+
// CHECK: @objc @_inheritsConvenienceInitializers public class Subclass : InheritedObjCInits.FrameworkObject {
10+
public class Subclass: FrameworkObject {
11+
// CHECK-NEXT: @objc override dynamic public init(selector: ObjectiveC.Selector)
12+
// CHECK-NEXT: @objc override dynamic public init(integer: Swift.Int)
13+
// CHECK-NEXT: @objc override dynamic public init()
14+
// CHECK-NEXT: @objc deinit
15+
} // CHECK-NEXT:{{^}$}}

0 commit comments

Comments
 (0)