Fix delegation to constructor of the same class in Objective-C subclasses
This commit is contained in:
Svyatoslav Scherbina
2018-09-04 18:47:06 +03:00
committed by SvyatoslavScherbina
parent 918d131285
commit 49eee47d7e
2 changed files with 8 additions and 1 deletions
@@ -45,6 +45,10 @@ fun run() {
pair.swap()
println("${pair.first}, ${pair.second}")
val defaultPair = MutablePairImpl()
assertEquals(defaultPair.first(), 123)
assertEquals(defaultPair.second(), 321)
// equals and hashCode (virtually):
val map = mapOf(foo to pair, pair to foo)
@@ -105,6 +109,8 @@ class MutablePairImpl(first: Int, second: Int) : NSObject(), MutablePairProtocol
override fun update(index: Int, sub: Int) {
elements[index] -= sub
}
constructor() : this(123, 321)
}
fun testTypeOps() {