File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+ #import < Foundation/Foundation.h>
2
+
3
+
4
+ // NB: No NS_ASSUME_NONNULL
5
+
6
+ @protocol FooProtocol <NSObject >
7
+
8
+ @property (nonatomic ,readonly ) NSString *name;
9
+
10
+ @end
11
+
12
+
13
+ @interface ParentClass : NSObject
14
+
15
+ - (instancetype )initWithFoo : (id <FooProtocol>)foo ;
16
+
17
+ @end
18
+
19
+
Original file line number Diff line number Diff line change
1
+ // SR-8789
2
+
3
+ // RUN: %target-swift-emit-silgen -verify -import-objc-header %S/Inputs/objc_init_iuo_override.h %s
4
+ // REQUIRES: objc_interop
5
+
6
+ class ChildClass : ParentClass { }
7
+
8
+ class GrandchildClass : ChildClass {
9
+ // The original init is defined in objc as:
10
+ // - (instancetype)initWithFoo:(id<FooProtocol>)foo;
11
+ // without nullability audits, meaning the signature in Swift is:
12
+ // init!(foo: FooProtocol)
13
+ // and
14
+ override init ( foo: FooProtocol ) {
15
+ super. init ( foo: foo)
16
+ }
17
+ }
18
+
You can’t perform that action at this time.
0 commit comments