Skip to content

Commit f2e48bd

Browse files
authored
Merge pull request swiftlang#76257 from AreaZR/e
Use instancetype for the benchmark and SwiftNativeNSObject
2 parents abfa450 + 7f2787e commit f2e48bd

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

benchmark/utils/ObjectiveCTests/ObjectiveCTests.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ NS_ASSUME_NONNULL_BEGIN
2323
NSArray<NSString *> *bridgedStrings;
2424
}
2525

26-
- (id)init;
26+
- (instancetype)init NS_DESIGNATED_INITIALIZER;
2727
- (void)setUpStringTests:(NSArray<NSString *> *)bridgedStrings;
2828
- (void)testFromString:(NSString *) str;
2929
- (NSString *)testToString;

benchmark/utils/ObjectiveCTests/ObjectiveCTests.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ - (const unichar *)_fastCharacterContents {
102102

103103
@implementation BridgeTester
104104

105-
- (id)init {
105+
- (instancetype)init {
106106
self = [super init];
107107
if (!self)
108108
return self;

stdlib/public/stubs/SwiftNativeNSObject.mm

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ @interface SwiftNativeNSObject : NSObject
3939

4040
@implementation SwiftNativeNSObject
4141

42-
+ (id)allocWithZone: (NSZone *)zone {
42+
+ (instancetype)allocWithZone: (NSZone *)zone {
4343
// Allocate the object with swift_allocObject().
4444
// Note that this doesn't work if called on SwiftNativeNSObject itself,
4545
// which is not a Swift class.
@@ -50,7 +50,7 @@ + (id)allocWithZone: (NSZone *)zone {
5050
return reinterpret_cast<id>(result);
5151
}
5252

53-
- (id)initWithCoder: (NSCoder *)coder {
53+
- (instancetype)initWithCoder: (NSCoder *)coder {
5454
return [super init];
5555
}
5656

stdlib/public/stubs/SwiftNativeNSXXXBase.mm.gyb

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ SWIFT_RUNTIME_STDLIB_API
6262

6363
@implementation __SwiftNativeNS${Class}Base
6464

65-
- (id)initWithCoder: (NSCoder *)coder {
65+
- (instancetype)initWithCoder: (NSCoder *)coder {
6666
return [super init];
6767
}
6868

0 commit comments

Comments
 (0)