[ObjCExport] Constructors fixes, cloneables handling, annotations
This commit is contained in:
committed by
Space Team
parent
545753ff4c
commit
0ec9f2a8b9
+43
@@ -0,0 +1,43 @@
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSError.h>
|
||||
#import <Foundation/NSObject.h>
|
||||
#import <Foundation/NSSet.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
|
||||
@class A;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wunknown-warning-option"
|
||||
#pragma clang diagnostic ignored "-Wincompatible-property-type"
|
||||
#pragma clang diagnostic ignored "-Wnullability"
|
||||
|
||||
#pragma push_macro("_Nullable_result")
|
||||
#if !__has_feature(nullability_nullable_result)
|
||||
#undef _Nullable_result
|
||||
#define _Nullable_result _Nullable
|
||||
#endif
|
||||
|
||||
@interface A : Base
|
||||
- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer));
|
||||
+ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead")));
|
||||
- (void)a0 __attribute__((swift_name("a0()")));
|
||||
- (void)a1I:(int32_t)i __attribute__((swift_name("a1(i:)")));
|
||||
- (void)a2B:(BOOL)b a:(id)a __attribute__((swift_name("a2(b:a:)")));
|
||||
@end
|
||||
|
||||
__attribute__((objc_subclassing_restricted))
|
||||
@interface B : A
|
||||
- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer));
|
||||
+ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead")));
|
||||
- (void)a0 __attribute__((swift_name("a0()")));
|
||||
- (void)a1I:(int32_t)i __attribute__((swift_name("a1(i:)")));
|
||||
- (void)a2B:(BOOL)b a:(id)a __attribute__((swift_name("a2(b:a:)")));
|
||||
- (void)b0 __attribute__((swift_name("b0()")));
|
||||
@end
|
||||
|
||||
#pragma pop_macro("_Nullable_result")
|
||||
#pragma clang diagnostic pop
|
||||
NS_ASSUME_NONNULL_END
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
abstract class A {
|
||||
abstract fun a0()
|
||||
abstract fun a1(i: Int)
|
||||
abstract fun a2(b: Boolean, a: Any)
|
||||
}
|
||||
|
||||
class B: A() {
|
||||
override fun a0() {}
|
||||
override fun a1(i: Int) {}
|
||||
override fun a2(b: Boolean, a: Any) {}
|
||||
|
||||
fun b0() {}
|
||||
}
|
||||
Reference in New Issue
Block a user