+2
@@ -885,6 +885,8 @@ class StubGenerator(
|
|||||||
if (configuration.library.language == Language.OBJECTIVE_C) {
|
if (configuration.library.language == Language.OBJECTIVE_C) {
|
||||||
add("CONFLICTING_OVERLOADS")
|
add("CONFLICTING_OVERLOADS")
|
||||||
add("RETURN_TYPE_MISMATCH_ON_INHERITANCE")
|
add("RETURN_TYPE_MISMATCH_ON_INHERITANCE")
|
||||||
|
add("PROPERTY_TYPE_MISMATCH_ON_INHERITANCE") // Multiple-inheriting property with conflicting types
|
||||||
|
add("VAR_TYPE_MISMATCH_ON_INHERITANCE") // Multiple-inheriting mutable property with conflicting types
|
||||||
add("RETURN_TYPE_MISMATCH_ON_OVERRIDE")
|
add("RETURN_TYPE_MISMATCH_ON_OVERRIDE")
|
||||||
add("WRONG_MODIFIER_CONTAINING_DECLARATION") // For `final val` in interface.
|
add("WRONG_MODIFIER_CONTAINING_DECLARATION") // For `final val` in interface.
|
||||||
add("PARAMETER_NAME_CHANGED_ON_OVERRIDE")
|
add("PARAMETER_NAME_CHANGED_ON_OVERRIDE")
|
||||||
|
|||||||
@@ -159,4 +159,20 @@ NSObject* createNSObject() {
|
|||||||
@interface TestOverrideInit : NSObject
|
@interface TestOverrideInit : NSObject
|
||||||
-(instancetype)initWithValue:(int)value NS_DESIGNATED_INITIALIZER;
|
-(instancetype)initWithValue:(int)value NS_DESIGNATED_INITIALIZER;
|
||||||
+(instancetype)createWithValue:(int)value;
|
+(instancetype)createWithValue:(int)value;
|
||||||
@end;
|
@end;
|
||||||
|
|
||||||
|
@interface MultipleInheritanceClashBase : NSObject
|
||||||
|
@property (nonnull) MultipleInheritanceClashBase* delegate;
|
||||||
|
@end;
|
||||||
|
|
||||||
|
@protocol MultipleInheritanceClash
|
||||||
|
@optional
|
||||||
|
@property (nullable) id<MultipleInheritanceClash> delegate;
|
||||||
|
@end;
|
||||||
|
|
||||||
|
@interface MultipleInheritanceClash1 : MultipleInheritanceClashBase <MultipleInheritanceClash>
|
||||||
|
@end;
|
||||||
|
|
||||||
|
@interface MultipleInheritanceClash2 : MultipleInheritanceClashBase <MultipleInheritanceClash>
|
||||||
|
@property MultipleInheritanceClashBase* delegate;
|
||||||
|
@end;
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ fun run() {
|
|||||||
testCustomRetain()
|
testCustomRetain()
|
||||||
testVarargs()
|
testVarargs()
|
||||||
testOverrideInit()
|
testOverrideInit()
|
||||||
|
testMultipleInheritanceClash()
|
||||||
|
|
||||||
assertEquals(2, ForwardDeclaredEnum.TWO.value)
|
assertEquals(2, ForwardDeclaredEnum.TWO.value)
|
||||||
|
|
||||||
@@ -310,6 +311,21 @@ class TestOverrideInitImpl @OverrideInit constructor(val value: Int) : TestOverr
|
|||||||
|
|
||||||
private class MyException : Throwable()
|
private class MyException : Throwable()
|
||||||
|
|
||||||
|
fun testMultipleInheritanceClash() {
|
||||||
|
val clash1 = MultipleInheritanceClash1()
|
||||||
|
val clash2 = MultipleInheritanceClash2()
|
||||||
|
|
||||||
|
clash1.delegate = clash1
|
||||||
|
assertEquals(clash1, clash1.delegate)
|
||||||
|
clash1.setDelegate(clash2)
|
||||||
|
assertEquals(clash2, clash1.delegate())
|
||||||
|
|
||||||
|
clash2.delegate = clash1
|
||||||
|
assertEquals(clash1, clash2.delegate)
|
||||||
|
clash2.setDelegate(clash2)
|
||||||
|
assertEquals(clash2, clash2.delegate())
|
||||||
|
}
|
||||||
|
|
||||||
fun nsArrayOf(vararg elements: Any): NSArray = NSMutableArray().apply {
|
fun nsArrayOf(vararg elements: Any): NSArray = NSMutableArray().apply {
|
||||||
elements.forEach {
|
elements.forEach {
|
||||||
this.addObject(it as ObjCObject)
|
this.addObject(it as ObjCObject)
|
||||||
|
|||||||
@@ -154,4 +154,13 @@ static CustomRetainMethodsImpl* retainedCustomRetainMethodsImpl;
|
|||||||
+(instancetype)createWithValue:(int)value {
|
+(instancetype)createWithValue:(int)value {
|
||||||
return [[self alloc] initWithValue:value];
|
return [[self alloc] initWithValue:value];
|
||||||
}
|
}
|
||||||
@end;
|
@end;
|
||||||
|
|
||||||
|
@implementation MultipleInheritanceClashBase
|
||||||
|
@end;
|
||||||
|
|
||||||
|
@implementation MultipleInheritanceClash1
|
||||||
|
@end;
|
||||||
|
|
||||||
|
@implementation MultipleInheritanceClash2
|
||||||
|
@end;
|
||||||
|
|||||||
Reference in New Issue
Block a user