Add trivial test for @OverrideInit

This commit is contained in:
Svyatoslav Scherbina
2019-04-17 13:52:29 +03:00
committed by SvyatoslavScherbina
parent 99e1ec6c9f
commit d90d6cd47a
3 changed files with 24 additions and 0 deletions
@@ -22,6 +22,7 @@ fun run() {
testBlocks()
testCustomRetain()
testVarargs()
testOverrideInit()
assertEquals(2, ForwardDeclaredEnum.TWO.value)
@@ -299,6 +300,14 @@ fun testVarargs() {
)
}
fun testOverrideInit() {
assertEquals(42, (TestOverrideInitImpl.createWithValue(42) as TestOverrideInitImpl).value)
}
class TestOverrideInitImpl @OverrideInit constructor(val value: Int) : TestOverrideInit(value) {
companion object : TestOverrideInitMeta()
}
private class MyException : Throwable()
fun nsArrayOf(vararg elements: Any): NSArray = NSMutableArray().apply {