Hello, I’m trying to do a kotlin multiplatform app, and I’m using ktor for network calls, but when I do a network call that fails on iOS, it crashes the app. The stack trace says that I should add the @Throws annotation I tried to add it as described here https://github.com/JetBrains/kotlin-native/issues/2122 and when I try to add it it as shown here
Copy code
actual typealias Throws = kotlin.native.Throws
and try to compile it gives me this error
Copy code
Right-hand side of actual type alias should be a class, not another type alias
a
Artyom Degtyarev [JB]
08/28/2020, 7:13 AM
AFAIK, there was a change made in 1.4, please see details here.
b
Big Chungus
08/28/2020, 8:59 AM
Just typealias to direct class that native @throws typealiases
r
russhwolf
08/28/2020, 12:21 PM
kotlin.Throws
exists in common in 1.4 so you shouldn’t need to do your own expect/actual or typealias anything.
s
ShawnV
08/28/2020, 4:21 PM
Oh, cool. I’ll try that now!
ShawnV
08/28/2020, 8:27 PM
Okay, just following up, and it looks like I just needed to do like @russhwolf said and use