Type mismatch: inferred type is ChallengeHandler /* = (NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, (NSURLSessionAuthChallengeDisposition /* = Long */, NSURLCredential?) -> Unit) -> Unit */ but ChallengeHandler /* = (NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, (NSURLSessionAuthChallengeDisposition /* = Int */, NSURLCredential?) -> Unit) -> Unit */ was expected
Basically above error logs happen when migrate to latest client ktor 2.0.3
and using kotlin 1.7.10
.
Is this a bug from ktor? how can we deal with this issue? should we just postponed update latest ktor until this issue fixed?
I think platform.darwin.NSInteger
is recognized as Long, thus it got mismatch.
when you search inside NSURLSessionAuthChallengeDisposition
this is platform.darwin.NSInteger
but somehow IDE recognized as Long
not Int
, so I guess this is a bug?
Run the build also failure by same error above
Can't do anything. tried to create extension to use Int
, still same..
Tried to cast manually to Int also still error.
Can't build too because of this error.
Anyone have solutions?
This can actually compiles just fine on native iOS. Should just ignore the error and provide an explanation in the comments section.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With