This commit is contained in:
committed by
GitHub
parent
b91f1d3fc7
commit
d6a4a3832e
@@ -348,6 +348,39 @@ __attribute__((swift_name("TestIncompatiblePropertyTypeWarning.ClassOverridingIn
|
||||
@property (readonly) KtTestIncompatiblePropertyTypeWarningGeneric<NSString *> *p __attribute__((swift_name("p")));
|
||||
@end;
|
||||
|
||||
__attribute__((objc_subclassing_restricted))
|
||||
__attribute__((swift_name("TestGH3992")))
|
||||
@interface KtTestGH3992 : KtBase
|
||||
- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer));
|
||||
+ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead")));
|
||||
@end;
|
||||
|
||||
__attribute__((swift_name("TestGH3992.C")))
|
||||
@interface KtTestGH3992C : KtBase
|
||||
- (instancetype)initWithA:(KtTestGH3992A *)a __attribute__((swift_name("init(a:)"))) __attribute__((objc_designated_initializer));
|
||||
@property (readonly) KtTestGH3992A *a __attribute__((swift_name("a")));
|
||||
@end;
|
||||
|
||||
__attribute__((objc_subclassing_restricted))
|
||||
__attribute__((swift_name("TestGH3992.D")))
|
||||
@interface KtTestGH3992D : KtTestGH3992C
|
||||
- (instancetype)initWithA:(KtTestGH3992B *)a __attribute__((swift_name("init(a:)"))) __attribute__((objc_designated_initializer));
|
||||
@property (readonly) KtTestGH3992B *a __attribute__((swift_name("a")));
|
||||
@end;
|
||||
|
||||
__attribute__((swift_name("TestGH3992.A")))
|
||||
@interface KtTestGH3992A : KtBase
|
||||
- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer));
|
||||
+ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead")));
|
||||
@end;
|
||||
|
||||
__attribute__((objc_subclassing_restricted))
|
||||
__attribute__((swift_name("TestGH3992.B")))
|
||||
@interface KtTestGH3992B : KtTestGH3992A
|
||||
- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer));
|
||||
+ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead")));
|
||||
@end;
|
||||
|
||||
__attribute__((objc_subclassing_restricted))
|
||||
__attribute__((swift_name("Kt35940Kt")))
|
||||
@interface KtKt35940Kt : KtBase
|
||||
|
||||
@@ -16,3 +16,14 @@ class TestIncompatiblePropertyTypeWarning {
|
||||
|
||||
class ClassOverridingInterfaceWithGenericProperty(override val p: Generic<String>) : InterfaceWithGenericProperty<String>
|
||||
}
|
||||
|
||||
// https://github.com/JetBrains/kotlin-native/issues/3992
|
||||
class TestGH3992 {
|
||||
abstract class C(open val a: A)
|
||||
|
||||
class D(override val a: B) : C(a)
|
||||
|
||||
abstract class A
|
||||
|
||||
class B : A()
|
||||
}
|
||||
|
||||
@@ -22,10 +22,21 @@ private func testIncompatiblePropertyType() throws {
|
||||
try assertEquals(actual: pi.value as! String, expected: "cba")
|
||||
}
|
||||
|
||||
private func testGH3992() throws {
|
||||
let d = TestGH3992.D(a: TestGH3992.B())
|
||||
let c: TestGH3992.C = d
|
||||
|
||||
let b: TestGH3992.B = d.a
|
||||
let a: TestGH3992.A = b
|
||||
|
||||
try assertTrue(a is TestGH3992.B)
|
||||
}
|
||||
|
||||
class HeaderWarningsTests : SimpleTestProvider {
|
||||
override init() {
|
||||
super.init()
|
||||
|
||||
test("TestIncompatiblePropertyType", testIncompatiblePropertyType)
|
||||
test("TestGH3992", testGH3992)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user