Konstantin Petrukhnov
09/12/2018, 9:24 AMsvyatoslav.scherbina
09/12/2018, 10:54 AMKonstantin Petrukhnov
09/13/2018, 6:10 AMKonstantin Petrukhnov
09/13/2018, 6:11 AMsvyatoslav.scherbina
09/13/2018, 6:58 AMMyLibInt extends MyLibNumber, which extend NSNumberExactly. And this means that you can apply to
[MyLibInt]
any operation that is allowed for [NSNumber]
. So what’s the reason to have [NSNumber]
instead of [MyLibInt]
?Konstantin Petrukhnov
09/13/2018, 7:26 AMKonstantin Petrukhnov
09/13/2018, 7:28 AMsvyatoslav.scherbina
09/13/2018, 7:31 AMKonstantin Petrukhnov
09/13/2018, 7:44 AMKonstantin Petrukhnov
09/13/2018, 7:46 AMsvyatoslav.scherbina
09/13/2018, 8:08 AMvar
, then it is incorrect to translate it as [NSNumber]
, because otherwise it would be possible to pass e.g. list of Double
instead of list of Int
, and Swift compiler wouldn’t help to prevent this.svyatoslav.scherbina
09/13/2018, 8:09 AM// Kotlin
var list: List<Int> = emptyList()
// Swift
Kotlin.list = [0.5]
Konstantin Petrukhnov
09/13/2018, 8:29 AMsvyatoslav.scherbina
09/13/2018, 8:35 AMKonstantin Petrukhnov
09/13/2018, 10:34 AMsvyatoslav.scherbina
09/13/2018, 11:30 AMKonstantin Petrukhnov
09/13/2018, 11:47 AM