Hey! I am using ktor ios engine to make get reques...
# kotlin-native
m
Hey! I am using ktor ios engine to make get requests. However, making get requests using client.get<String>(url) results in cinterop error as the native compiler treats get as cinterop function instead of the ktor function. Is there a way to force the compiler? Also, with multithreading not supported in native coroutines, I wonder if there is a way to avoid ui freezing while calking client.
m
The build error for get says:
Copy code
Error:Error:line (74)unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
    public inline operator fun <reified T : CVariable> CPointer<String>.get(index: Int): String defined in kotlinx.cinterop
    public inline operator fun <reified T : CVariable> CPointer<String>.get(index: Long): String defined in kotlinx.cinterop
    public inline operator fun <T : Byte> CPointer<ByteVarOf<String>>.get(index: Int): String defined in kotlinx.cinterop
    public inline operator fun <T : Byte> CPointer<ByteVarOf<String>>.get(index: Long): String defined in kotlinx.cinterop
    public inline operator fun <T : CPointer<*>> CPointer<CPointerVarOf<String>>.get(index: Int): String? defined in kotlinx.cinterop
    public inline operator fun <T : CPointer<*>> CPointer<CPointerVarOf<String>>.get(index: Long): String? defined in kotlinx.cinterop
    public inline operator fun <T : Double> CPointer<DoubleVarOf<String>>.get(index: Int): String defined in kotlinx.cinterop
    public inline operator fun <T : Double> CPointer<DoubleVarOf<String>>.get(index: Long): String defined in kotlinx.cinterop
    public inline operator fun <T : Float> CPointer<FloatVarOf<String>>.get(index: Int): String defined in kotlinx.cinterop
    public inline operator fun <T : Float> CPointer<FloatVarOf<String>>.get(index: Long): String defined in kotlinx.cinterop
    public inline operator fun <T : Int> CPointer<IntVarOf<String>>.get(index: Int): String defined in kotlinx.cinterop
    public inline operator fun <T : Int> CPointer<IntVarOf<String>>.get(index: Long): String defined in kotlinx.cinterop
    public inline operator fun <T : Long> CPointer<LongVarOf<String>>.get(index: Int): String defined in kotlinx.cinterop
    public inline operator fun <T : Long> CPointer<LongVarOf<String>>.get(index: Long): String defined in kotlinx.cinterop
    public inline operator fun <T : Short> CPointer<ShortVarOf<String>>.get(index: Int): String defined in kotlinx.cinterop
    public inline operator fun <T : Short> CPointer<ShortVarOf<String>>.get(index: Long): String defined in kotlinx.cinterop
            val htmlContent : String = client.get<String>("<https://en.wikipedia.org/wiki/Main_Page>")
o
Please use bug tracker
👍 1