[KT-52681] Remove unnecessary semicolon after Objective-C @end
Objective-c `@end` doesn't need a semicolon, however KMM exported header
file, for instance:
```
__attribute__((swift_name("KotlinIterator")))
@protocol MyProjectKotlinIterator
@required
- (BOOL)hasNext __attribute__((swift_name("hasNext()")));
- (id _Nullable)next __attribute__((swift_name("next()")));
@end;
```
This creates problems with some code checkers that will not expect it
there, so it seems best to remove it.
This commit is contained in:
committed by
SvyatoslavScherbina
parent
3840d09314
commit
9a430efbe7
@@ -3,7 +3,7 @@
|
||||
#import <Foundation/NSUUID.h>
|
||||
|
||||
@interface MyClass1 : NSObject
|
||||
@end;
|
||||
@end
|
||||
|
||||
@interface MyClass2 : NSObject
|
||||
@end;
|
||||
@end
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
+ (double)doubleFn;
|
||||
+ (simd_float4)simdFn;
|
||||
|
||||
@end;
|
||||
@end
|
||||
|
||||
typedef struct {
|
||||
float f;
|
||||
@@ -65,4 +65,4 @@ typedef struct {
|
||||
+ (GeterogeneousSmall)geterogeneousSmallFn;
|
||||
|
||||
|
||||
@end;
|
||||
@end
|
||||
@@ -23,7 +23,7 @@
|
||||
return v;
|
||||
}
|
||||
|
||||
@end;
|
||||
@end
|
||||
|
||||
@implementation AggregateTestSubject
|
||||
|
||||
@@ -78,4 +78,4 @@
|
||||
return (simd_quatf){ {1, 4, 9, 25} };
|
||||
}
|
||||
|
||||
@end;
|
||||
@end
|
||||
@@ -7,7 +7,7 @@
|
||||
@protocol Printer;
|
||||
|
||||
@protocol Empty
|
||||
@end;
|
||||
@end
|
||||
|
||||
@protocol Forward;
|
||||
@class Forward;
|
||||
@@ -20,16 +20,16 @@ typedef NSString NSStringTypedef;
|
||||
@interface Foo : NSObject <Empty>
|
||||
@property NSStringTypedef* name;
|
||||
-(void)helloWithPrinter:(id <Printer>)printer;
|
||||
@end;
|
||||
@end
|
||||
|
||||
@interface Foo (FooExtensions)
|
||||
-(void)hello;
|
||||
@end;
|
||||
@end
|
||||
|
||||
@protocol Printer
|
||||
@required
|
||||
-(void)print:(const char*)string;
|
||||
@end;
|
||||
@end
|
||||
|
||||
@protocol MutablePair
|
||||
@required
|
||||
@@ -39,7 +39,7 @@ typedef NSString NSStringTypedef;
|
||||
-(void)update:(int)index add:(int)delta;
|
||||
-(void)update:(int)index sub:(int)delta;
|
||||
|
||||
@end;
|
||||
@end
|
||||
|
||||
void replacePairElements(id <MutablePair> pair, int first, int second);
|
||||
|
||||
@@ -70,7 +70,7 @@ typedef NS_ENUM(int32_t, ForwardDeclaredEnum) {
|
||||
@protocol ObjectFactory
|
||||
@required
|
||||
-(id)create;
|
||||
@end;
|
||||
@end
|
||||
|
||||
id createObjectWithFactory(id<ObjectFactory> factory) {
|
||||
return [factory create];
|
||||
@@ -82,15 +82,15 @@ id createObjectWithFactory(id<ObjectFactory> factory) {
|
||||
-(void)consume:(id) __attribute__((ns_consumed)) obj;
|
||||
-(void)consumeSelf __attribute__((ns_consumes_self));
|
||||
-(void (^)(void))returnRetainedBlock:(void (^)(void))block __attribute__((ns_returns_retained));
|
||||
@end;
|
||||
@end
|
||||
|
||||
extern BOOL unexpectedDeallocation;
|
||||
|
||||
@interface MustNotBeDeallocated : NSObject
|
||||
@end;
|
||||
@end
|
||||
|
||||
@interface CustomRetainMethodsImpl : MustNotBeDeallocated <CustomRetainMethods>
|
||||
@end;
|
||||
@end
|
||||
|
||||
static MustNotBeDeallocated* retainedObj;
|
||||
static void (^retainedBlock)(void);
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
|
||||
@interface CPrinter : NSObject <Printer>
|
||||
-(void)print:(const char*)string;
|
||||
@end;
|
||||
@end
|
||||
|
||||
@implementation CPrinter
|
||||
-(void)print:(const char*)string {
|
||||
printf("%s\n", string);
|
||||
fflush(stdout);
|
||||
}
|
||||
@end;
|
||||
@end
|
||||
|
||||
@implementation Foo
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
printf("Deallocated\n");
|
||||
}
|
||||
|
||||
@end;
|
||||
@end
|
||||
|
||||
@implementation Foo (FooExtensions)
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
CPrinter* printer = [[CPrinter alloc] init];
|
||||
[self helloWithPrinter:printer];
|
||||
}
|
||||
@end;
|
||||
@end
|
||||
|
||||
void replacePairElements(id <MutablePair> pair, int first, int second) {
|
||||
[pair update:0 add:(first - pair.first)];
|
||||
@@ -75,7 +75,7 @@ BOOL unexpectedDeallocation = NO;
|
||||
-(void)dealloc {
|
||||
unexpectedDeallocation = YES;
|
||||
}
|
||||
@end;
|
||||
@end
|
||||
|
||||
static CustomRetainMethodsImpl* retainedCustomRetainMethodsImpl;
|
||||
|
||||
@@ -94,4 +94,4 @@ static CustomRetainMethodsImpl* retainedCustomRetainMethodsImpl;
|
||||
-(void (^)(void))returnRetainedBlock:(void (^)(void))block __attribute__((ns_returns_retained)) {
|
||||
return block;
|
||||
}
|
||||
@end;
|
||||
@end
|
||||
|
||||
@@ -8,5 +8,5 @@
|
||||
@property (nonatomic, readonly) NSObject *copyValue;
|
||||
@property (nonatomic, readonly) NSObject *mutableCopyValue;
|
||||
|
||||
@end;
|
||||
@end
|
||||
|
||||
|
||||
@@ -17,4 +17,4 @@
|
||||
return nil;
|
||||
}
|
||||
|
||||
@end;
|
||||
@end
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
@protocol KT38234_P1
|
||||
-(int)foo;
|
||||
@end;
|
||||
@end
|
||||
|
||||
@interface KT38234_Base : NSObject <KT38234_P1>
|
||||
-(int)callFoo;
|
||||
@end;
|
||||
@end
|
||||
|
||||
@@ -7,4 +7,4 @@
|
||||
-(int)callFoo {
|
||||
return [self foo];
|
||||
}
|
||||
@end;
|
||||
@end
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
@interface TestAllocNoRetain : NSObject
|
||||
@property BOOL ok;
|
||||
@end;
|
||||
@end
|
||||
@@ -11,4 +11,4 @@
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@end;
|
||||
@end
|
||||
@@ -3,7 +3,7 @@
|
||||
@protocol BlockProvider
|
||||
@required
|
||||
-(int (^)(int)) block;
|
||||
@end;
|
||||
@end
|
||||
|
||||
int callProvidedBlock(id<BlockProvider> blockProvider, int argument) {
|
||||
return [blockProvider block](argument);
|
||||
@@ -12,7 +12,7 @@ int callProvidedBlock(id<BlockProvider> blockProvider, int argument) {
|
||||
@protocol BlockConsumer
|
||||
@required
|
||||
-(int)callBlock:(int (^)(int))block argument:(int)argument;
|
||||
@end;
|
||||
@end
|
||||
|
||||
int callPlusOneBlock(id<BlockConsumer> blockConsumer, int argument) {
|
||||
return [blockConsumer callBlock:^int(int p) { return p + 1; } argument:argument];
|
||||
@@ -24,4 +24,4 @@ int callPlusOneBlock(id<BlockConsumer> blockConsumer, int argument) {
|
||||
|
||||
@property (class) void (^nullBlock)(void);
|
||||
@property (class) void (^notNullBlock)(void);
|
||||
@end;
|
||||
@end
|
||||
|
||||
@@ -17,4 +17,4 @@
|
||||
return ^{};
|
||||
}
|
||||
|
||||
@end;
|
||||
@end
|
||||
@@ -4,4 +4,4 @@
|
||||
@property int value;
|
||||
- (int)instanceMethod;
|
||||
+ (int)classMethod:(int)first :(int)second;
|
||||
@end;
|
||||
@end
|
||||
@@ -8,4 +8,4 @@
|
||||
+ (int)classMethod:(int)first :(int)second {
|
||||
return first + second;
|
||||
}
|
||||
@end;
|
||||
@end
|
||||
@@ -6,17 +6,17 @@
|
||||
-(NSString*)toString_;
|
||||
-(int)hashCode;
|
||||
-(BOOL)equals:(id _Nullable)other;
|
||||
@end;
|
||||
@end
|
||||
|
||||
@interface TestClashingWithAny2 : NSObject
|
||||
-(void)toString;
|
||||
-(void)hashCode;
|
||||
-(void)equals:(int)p; // May clash.
|
||||
@end;
|
||||
@end
|
||||
|
||||
@interface TestClashingWithAny3 : NSObject
|
||||
// Not clashing actually.
|
||||
-(NSString*)toString:(int)p;
|
||||
-(int)hashCode:(int)p;
|
||||
-(BOOL)equals;
|
||||
@end;
|
||||
@end
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
-(BOOL)equals:(id _Nullable)other {
|
||||
return YES;
|
||||
}
|
||||
@end;
|
||||
@end
|
||||
|
||||
@implementation TestClashingWithAny2
|
||||
-(NSString*)description {
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
-(void)equals:(int)p {
|
||||
}
|
||||
@end;
|
||||
@end
|
||||
|
||||
@implementation TestClashingWithAny3
|
||||
-(NSString*)description {
|
||||
@@ -65,4 +65,4 @@
|
||||
-(BOOL)equals {
|
||||
return YES;
|
||||
}
|
||||
@end;
|
||||
@end
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
@interface TestConstructorReturnsNull : NSObject
|
||||
- (instancetype)init;
|
||||
@end;
|
||||
@end
|
||||
@@ -4,4 +4,4 @@
|
||||
- (instancetype)init {
|
||||
return nil;
|
||||
}
|
||||
@end;
|
||||
@end
|
||||
@@ -3,7 +3,7 @@
|
||||
@interface CustomString : NSString
|
||||
- (instancetype)initWithValue:(int)value;
|
||||
@property int value;
|
||||
@end;
|
||||
@end
|
||||
|
||||
CustomString* _Nonnull createCustomString(int value) {
|
||||
return [[CustomString alloc] initWithValue:value];
|
||||
|
||||
@@ -29,4 +29,4 @@ BOOL customStringDeallocated = NO;
|
||||
- (void)dealloc {
|
||||
customStringDeallocated = YES;
|
||||
}
|
||||
@end;
|
||||
@end
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
@protocol ExceptionThrower
|
||||
-(void)throwException;
|
||||
@end;
|
||||
@end
|
||||
|
||||
@interface ExceptionThrowerManager : NSObject
|
||||
+(void)throwExceptionWith:(id<ExceptionThrower>)thrower;
|
||||
@end;
|
||||
@end
|
||||
|
||||
@@ -4,4 +4,4 @@
|
||||
+(void)throwExceptionWith:(id<ExceptionThrower>)thrower {
|
||||
[thrower throwException];
|
||||
}
|
||||
@end;
|
||||
@end
|
||||
@@ -5,4 +5,4 @@
|
||||
@property BOOL custom;
|
||||
|
||||
+(instancetype _Nonnull)createCustom;
|
||||
@end;
|
||||
@end
|
||||
@@ -20,4 +20,4 @@
|
||||
return [[self alloc] initCustom];
|
||||
}
|
||||
|
||||
@end;
|
||||
@end
|
||||
@@ -5,6 +5,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@interface KT38850Color : NSObject
|
||||
+(instancetype)blackColor;
|
||||
@property NSString* name;
|
||||
@end;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -6,4 +6,4 @@
|
||||
result.name = @"black";
|
||||
return result;
|
||||
}
|
||||
@end;
|
||||
@end
|
||||
|
||||
@@ -3,22 +3,22 @@
|
||||
extern BOOL deallocRetainReleaseDeallocated;
|
||||
|
||||
@interface DeallocRetainRelease : NSObject
|
||||
@end;
|
||||
@end
|
||||
|
||||
extern DeallocRetainRelease* globalDeallocRetainRelease;
|
||||
|
||||
@protocol WeakReference
|
||||
@required
|
||||
@property (weak) id referent;
|
||||
@end;
|
||||
@end
|
||||
|
||||
@interface ObjCWeakReference : NSObject <WeakReference>
|
||||
@property (weak) id referent;
|
||||
@end;
|
||||
@end
|
||||
|
||||
extern id <WeakReference> weakDeallocLoadWeak;
|
||||
extern BOOL deallocLoadWeakDeallocated;
|
||||
|
||||
@interface DeallocLoadWeak : NSObject
|
||||
-(void)checkWeak;
|
||||
@end;
|
||||
@end
|
||||
|
||||
@@ -13,12 +13,12 @@ BOOL deallocRetainReleaseDeallocated = NO;
|
||||
assert(!deallocRetainReleaseDeallocated);
|
||||
deallocRetainReleaseDeallocated = YES;
|
||||
}
|
||||
@end;
|
||||
@end
|
||||
|
||||
DeallocRetainRelease* globalDeallocRetainRelease = nil;
|
||||
|
||||
@implementation ObjCWeakReference
|
||||
@end;
|
||||
@end
|
||||
|
||||
id <WeakReference> weakDeallocLoadWeak = nil;
|
||||
BOOL deallocLoadWeakDeallocated = NO;
|
||||
@@ -36,4 +36,4 @@ BOOL deallocLoadWeakDeallocated = NO;
|
||||
assert(!deallocLoadWeakDeallocated);
|
||||
deallocLoadWeakDeallocated = YES;
|
||||
}
|
||||
@end;
|
||||
@end
|
||||
|
||||
@@ -5,6 +5,6 @@ extern id kt42482Global;
|
||||
|
||||
@interface KT42482 : NSObject
|
||||
-(int)fortyTwo;
|
||||
@end;
|
||||
@end
|
||||
|
||||
void kt42482Swizzle(id obj);
|
||||
|
||||
@@ -13,7 +13,7 @@ id kt42482Global = nil;
|
||||
-(void)dealloc {
|
||||
kt42482Deallocated = YES;
|
||||
}
|
||||
@end;
|
||||
@end
|
||||
|
||||
int fortyTwoSwizzledImp(id self, SEL _cmd) {
|
||||
return 43;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// https://youtrack.jetbrains.com/issue/KT-49455
|
||||
|
||||
@interface KT49455 : NSObject
|
||||
@end;
|
||||
@end
|
||||
|
||||
__attribute__((external_source_symbol(language="Swift", defined_in="sample",generated_declaration)))
|
||||
@interface KT49455 (KT49455Ext)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#import "kt49455.h"
|
||||
|
||||
@implementation KT49455
|
||||
@end;
|
||||
@end
|
||||
|
||||
@implementation KT49455 (KT49455Ext)
|
||||
- (int)extensionFunction {
|
||||
|
||||
@@ -18,8 +18,8 @@ struct MyStruct myStruct = {11, 12, 13, 14};
|
||||
|
||||
@protocol Proto
|
||||
@property int Companion; // clash on implementing
|
||||
@end;
|
||||
@end
|
||||
|
||||
@interface FooMangled : NSObject<Proto>
|
||||
//- (void) CompanionS; // mangleSimple does not support this: it may clash after mangling
|
||||
@end;
|
||||
@end
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
// [KT-36067] mangling
|
||||
@implementation FooMangled : NSObject
|
||||
@synthesize Companion;
|
||||
@end;
|
||||
@end
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
|
||||
@interface MultipleInheritanceClashBase : NSObject
|
||||
@property (nonnull) MultipleInheritanceClashBase* delegate;
|
||||
@end;
|
||||
@end
|
||||
|
||||
@protocol MultipleInheritanceClash
|
||||
@optional
|
||||
@property (nullable) id<MultipleInheritanceClash> delegate;
|
||||
@end;
|
||||
@end
|
||||
|
||||
@interface MultipleInheritanceClash1 : MultipleInheritanceClashBase <MultipleInheritanceClash>
|
||||
@end;
|
||||
@end
|
||||
|
||||
@interface MultipleInheritanceClash2 : MultipleInheritanceClashBase <MultipleInheritanceClash>
|
||||
@property MultipleInheritanceClashBase* delegate;
|
||||
@end;
|
||||
@end
|
||||
@@ -1,10 +1,10 @@
|
||||
#import "multipleInheritanceClash.h"
|
||||
|
||||
@implementation MultipleInheritanceClashBase
|
||||
@end;
|
||||
@end
|
||||
|
||||
@implementation MultipleInheritanceClash1
|
||||
@end;
|
||||
@end
|
||||
|
||||
@implementation MultipleInheritanceClash2
|
||||
@end;
|
||||
@end
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
|
||||
@interface DeallocExecutor : NSObject
|
||||
@property DeallocListener* deallocListener;
|
||||
@end;
|
||||
@end
|
||||
|
||||
@interface DeallocListener : NSObject
|
||||
@property (weak) DeallocExecutor* deallocExecutor;
|
||||
@property BOOL deallocated;
|
||||
-(BOOL)deallocExecutorIsNil;
|
||||
@end;
|
||||
@end
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
-(void)dealloc {
|
||||
self.deallocListener.deallocated = YES;
|
||||
}
|
||||
@end;
|
||||
@end
|
||||
|
||||
@implementation DeallocListener
|
||||
-(BOOL)deallocExecutorIsNil {
|
||||
return self.deallocExecutor == nil;
|
||||
}
|
||||
@end;
|
||||
@end
|
||||
@@ -3,4 +3,4 @@
|
||||
@interface TestOverrideInit : NSObject
|
||||
-(instancetype)initWithValue:(int)value NS_DESIGNATED_INITIALIZER;
|
||||
+(instancetype)createWithValue:(int)value;
|
||||
@end;
|
||||
@end
|
||||
@@ -8,4 +8,4 @@
|
||||
+(instancetype)createWithValue:(int)value {
|
||||
return [[self alloc] initWithValue:value];
|
||||
}
|
||||
@end;
|
||||
@end
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
@interface WeakRefHolder : NSObject
|
||||
@property (weak) id obj;
|
||||
-(void)loadManyTimes;
|
||||
@end;
|
||||
@end
|
||||
@@ -8,4 +8,4 @@
|
||||
[array addObject:self.obj];
|
||||
}
|
||||
}
|
||||
@end;
|
||||
@end
|
||||
@@ -7,14 +7,14 @@
|
||||
|
||||
+(NSString* _Nonnull)stringWithFormat:(NSString*)format, ...;
|
||||
+(NSObject* _Nonnull)stringWithFormat:(NSString*)format args:(void*)args;
|
||||
@end;
|
||||
@end
|
||||
|
||||
@interface TestVarargs (TestVarargsExtension)
|
||||
-(instancetype _Nonnull)initWithFormat:(NSString*)format, ...;
|
||||
@end;
|
||||
@end
|
||||
|
||||
@interface TestVarargsSubclass : TestVarargs
|
||||
// Test clashes:
|
||||
-(instancetype _Nonnull)initWithFormat:(NSString*)format args:(void*)args;
|
||||
+(NSString* _Nonnull)stringWithFormat:(NSString*)format args:(void*)args;
|
||||
@end;
|
||||
@end
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
abort();
|
||||
}
|
||||
|
||||
@end;
|
||||
@end
|
||||
|
||||
@implementation TestVarargsSubclass
|
||||
-(instancetype _Nonnull)initWithFormat:(NSString*)format args:(void*)args {
|
||||
@@ -48,4 +48,4 @@
|
||||
+(NSString* _Nonnull)stringWithFormat:(NSString*)format args:(void*)args {
|
||||
abort();
|
||||
}
|
||||
@end;
|
||||
@end
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
@interface CreateAutoreleaseDeallocated : NSObject
|
||||
@property BOOL value;
|
||||
@end;
|
||||
@end
|
||||
|
||||
@interface CreateAutorelease : NSObject
|
||||
+(void)createAutorelease:(CreateAutoreleaseDeallocated*)deallocated;
|
||||
@end;
|
||||
@end
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#import "workerAutoreleasePool.h"
|
||||
|
||||
@implementation CreateAutoreleaseDeallocated
|
||||
@end;
|
||||
@end
|
||||
|
||||
@implementation CreateAutorelease {
|
||||
CreateAutoreleaseDeallocated* deallocated;
|
||||
@@ -17,4 +17,4 @@
|
||||
-(void)dealloc {
|
||||
deallocated.value = YES;
|
||||
}
|
||||
@end;
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user