mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #76257 from AreaZR/e
Use instancetype for the benchmark and SwiftNativeNSObject
This commit is contained in:
@@ -23,7 +23,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
NSArray<NSString *> *bridgedStrings;
|
NSArray<NSString *> *bridgedStrings;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)init;
|
- (instancetype)init NS_DESIGNATED_INITIALIZER;
|
||||||
- (void)setUpStringTests:(NSArray<NSString *> *)bridgedStrings;
|
- (void)setUpStringTests:(NSArray<NSString *> *)bridgedStrings;
|
||||||
- (void)testFromString:(NSString *) str;
|
- (void)testFromString:(NSString *) str;
|
||||||
- (NSString *)testToString;
|
- (NSString *)testToString;
|
||||||
|
|||||||
@@ -102,7 +102,7 @@
|
|||||||
|
|
||||||
@implementation BridgeTester
|
@implementation BridgeTester
|
||||||
|
|
||||||
- (id)init {
|
- (instancetype)init {
|
||||||
self = [super init];
|
self = [super init];
|
||||||
if (!self)
|
if (!self)
|
||||||
return self;
|
return self;
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ SWIFT_RUNTIME_STDLIB_API
|
|||||||
|
|
||||||
@implementation SwiftNativeNSObject
|
@implementation SwiftNativeNSObject
|
||||||
|
|
||||||
+ (id)allocWithZone: (NSZone *)zone {
|
+ (instancetype)allocWithZone: (NSZone *)zone {
|
||||||
// Allocate the object with swift_allocObject().
|
// Allocate the object with swift_allocObject().
|
||||||
// Note that this doesn't work if called on SwiftNativeNSObject itself,
|
// Note that this doesn't work if called on SwiftNativeNSObject itself,
|
||||||
// which is not a Swift class.
|
// which is not a Swift class.
|
||||||
@@ -50,7 +50,7 @@ SWIFT_RUNTIME_STDLIB_API
|
|||||||
return reinterpret_cast<id>(result);
|
return reinterpret_cast<id>(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)initWithCoder: (NSCoder *)coder {
|
- (instancetype)initWithCoder: (NSCoder *)coder {
|
||||||
return [super init];
|
return [super init];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ SWIFT_RUNTIME_STDLIB_API
|
|||||||
|
|
||||||
@implementation __SwiftNativeNS${Class}Base
|
@implementation __SwiftNativeNS${Class}Base
|
||||||
|
|
||||||
- (id)initWithCoder: (NSCoder *)coder {
|
- (instancetype)initWithCoder: (NSCoder *)coder {
|
||||||
return [super init];
|
return [super init];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user