問題タブ [kotlin-multiplatform]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
1 に答える
2165 参照

ios - kotlin.native.concurrent.InvalidMutabilityException: 凍結の突然変異の試み when using ktor in Kotlin Multiplatform (iOS)

I am trying to build a simple Kotlin Multiplatform app that calls to the internet to fetch some Strings from the intern

I am trying to build a simple Kotlin Multiplatform app that calls to the internet to fetch some Strings from the internet with ktor. I took some functions from Kotlin conference app which I compiled and it works fine on both Android and iOS.

However, in my sample app, it only works on Android, but on iOS it returns

kotlin.native.concurrent.InvalidMutabilityException: mutation attempt of frozen <object>@c422ffe8

Here is the GitHub repository and below is my code:

--

--

--


How recursive function control flow change for static variable?

I am trying to learn some stuff about recursive function and I try to run this

I am expecting that it will give me an output like this as similar to any local variable called in a recursive function.

But compiler gives me an output like this

I can't understand why this kind of output comes. Can anyone explain?