is it true that not fully implementing a Kotlin interface in swift generates a compile time error, but not fully implementing an abstract base class only generates a runtime error when you try to call an unimplemented abstract function? is there a way to move that error into build time?
David Stolarsky
05/08/2019, 3:48 AM
hmm maybe i can just replace
abstract class
with
interface
and refactor its constructor? because interfaces can implement methods?
David Stolarsky
05/08/2019, 3:49 AM
also refactor the property initializers
David Stolarsky
05/08/2019, 4:23 AM
hmm i tried moving an abstract fun definition into a parent interface, but the swift still compiles without implementing that method
David Stolarsky
05/08/2019, 4:32 AM
switching to an interface feels like a bad compromise. calling unimplemented abstract methods should produce a build error.
s
svyatoslav.scherbina
05/13/2019, 8:02 AM
Unfortunately, interoperability between Kotlin and Swift currently works through Objective-C layer, and the latter doesn’t have a notion of abstract methods. So it doesn’t seem possible to produce a build error here.