Hi,
Kotlin: 1.2.31
Kotlin-Native: 0.6.2
I’m starting to use Kotlin Multiplatform features and I’m having trouble defining typealias for iOS native module.
I want to have an expect class URL
in my common module and use platform specific classes in each module:
JVM:
import java.net.URL
actual typealias URL = URL
iOS-native:
import platform.Foundation.*
actual typealias URL = NSURL
In Java it compiles without problems, but on iOS it’s having trouble with this error:
[system.err] .../URL.kt:5:1: error: conflicting overloads: @ObjCConstructor public final actual fun <init>(path: String, relativeToURL: NSURL?): URL /* = NSURL */ defined in com.climbaround.common.types.URL, @ObjCConstructor public final actual fun <init>(path: String): URL /* = NSURL */ defined in com.climbaround.common.types.URL, @ObjCConstructor public final actual fun <init>(URLString: String): URL /* = NSURL */ defined in com.climbaround.common.types.URL, @ObjCConstructor public final actual fun <init>(URLString: String, relativeToURL: NSURL?): URL /* = NSURL */ defined in com.climbaround.common.types.URL, @ObjCConstructor public final actual fun <init>(data: NSData, relativeToURL: NSURL?): URL /* = NSURL */ defined in com.climbaround.common.types.URL, @ObjCConstructor public final actual fun <init>(data: NSData, relativeToURL: NSURL?): URL /* = NSURL */ defined in com.climbaround.common.types.URL
[system.err] actual typealias URL = NSURL
[system.err] ^
I haven’t found any documentation about how to solve this.
Thanks a lot.