# Latest

**URL:** https://discuss.kotlinlang.org/latest.md?page=1

[Latest](https://discuss.kotlinlang.org/latest.md) · [Categories](https://discuss.kotlinlang.org/categories.md)

**Page:** 2

---

## [How to do WASM Unit tests with function defined in Index.html?](https://discuss.kotlinlang.org/t/how-to-do-wasm-unit-tests-with-function-defined-in-index-html/31063)

<div class="topic-metadata">

**Author:** [@monoseb](https://discuss.kotlinlang.org/u/monoseb)\
**Replies:** 0\
**Last updated:** [May 19, 2026, 7:38am UTC](https://discuss.kotlinlang.org/t/how-to-do-wasm-unit-tests-with-function-defined-in-index-html/31063 "2026-05-19T07:38:46Z")

</div>

Hello, I created a simple function in my index.html that is called in my feature.wasm.kt as an external function. external fun myFunction(text: String): JSArray\<JsString\> in Kotlin and in index.html \<script\> functi…

---

## [Rust-style variable shadowing](https://discuss.kotlinlang.org/t/rust-style-variable-shadowing/16338)

<div class="topic-metadata">

**Author:** [@lkowarschick](https://discuss.kotlinlang.org/u/lkowarschick)\
**Replies:** 52\
**Last updated:** [May 14, 2026, 1:35pm UTC](https://discuss.kotlinlang.org/t/rust-style-variable-shadowing/16338 "2026-05-14T13:35:41Z")

</div>

Preface Having worked with Rust recently, I’ve come to like one very specific feature a lot: Variable shadowing. In rust it is possible to shadow variable names without warnings or errors, even in the same scope, and I …

---

## [When call Java method in Gradle Kotlin DSL: Argument type mismatch: actual type is 'kotlin.String?', but '@Nullable() kotlin.String' was expected](https://discuss.kotlinlang.org/t/when-call-java-method-in-gradle-kotlin-dsl-argument-type-mismatch-actual-type-is-kotlin-string-but-nullable-kotlin-string-was-expected/30094)

<div class="topic-metadata">

**Author:** [@h0cheung](https://discuss.kotlinlang.org/u/h0cheung)\
**Replies:** 1\
**Last updated:** [May 11, 2026, 3:11pm UTC](https://discuss.kotlinlang.org/t/when-call-java-method-in-gradle-kotlin-dsl-argument-type-mismatch-actual-type-is-kotlin-string-but-nullable-kotlin-string-was-expected/30094 "2026-05-11T15:11:34Z")

</div>

I’m using the file filter in jar task to remove some SPI. filesMatching("inst/META-INF/services/\*") { filter { line -\> if (line.startsWith("com.example.")) { null } else { line } } } The sig…

---

## [Ordered Sets](https://discuss.kotlinlang.org/t/ordered-sets/5420)

<div class="topic-metadata">

**Author:** [@nanodeath](https://discuss.kotlinlang.org/u/nanodeath)\
**Replies:** 5\
**Last updated:** [May 4, 2026, 8:55am UTC](https://discuss.kotlinlang.org/t/ordered-sets/5420 "2026-05-04T08:55:15Z")

</div>

Hey folks, The Java collections frameworks, frustratingly, lacks any interface that indicates “an ordered collection of unique elements”, and Kotlin doesn’t step in and provide an interface/class either. So…I’m curious …

---

## [What is the receiver supposed to be in a \`withContext\` block (and an extension function)?](https://discuss.kotlinlang.org/t/what-is-the-receiver-supposed-to-be-in-a-withcontext-block-and-an-extension-function/31031)

<div class="topic-metadata">

**Author:** [@nikclayton](https://discuss.kotlinlang.org/u/nikclayton)\
**Replies:** 5\
**Last updated:** [April 20, 2026, 1:27pm UTC](https://discuss.kotlinlang.org/t/what-is-the-receiver-supposed-to-be-in-a-withcontext-block-and-an-extension-function/31031 "2026-04-20T13:27:30Z")

</div>

What is the receiver supposed to be in a withContext block in an extension function? Consider the following example: import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.runBlocking import kotlinx.coroutines…

---

## [BasicJvmScriptingHost imports not working with StringScriptSource](https://discuss.kotlinlang.org/t/basicjvmscriptinghost-imports-not-working-with-stringscriptsource/24919)

<div class="topic-metadata">

**Author:** [@CptCaptain](https://discuss.kotlinlang.org/u/CptCaptain)\
**Replies:** 3\
**Last updated:** [April 19, 2026, 10:27am UTC](https://discuss.kotlinlang.org/t/basicjvmscriptinghost-imports-not-working-with-stringscriptsource/24919 "2026-04-19T10:27:14Z")

</div>

Hi all! I am trying to use imports with the BasicJvmScriptingHost with StringScriptSource instead of FileScriptSource. Unfortunately it is not working as expected. This is my test code: import java.nio.file.Files import…

---

## [Compilation using 2.3.0 hangs](https://discuss.kotlinlang.org/t/compilation-using-2-3-0-hangs/30908)

<div class="topic-metadata">

**Author:** [@jstuyts](https://discuss.kotlinlang.org/u/jstuyts)\
**Replies:** 5\
**Last updated:** [April 15, 2026, 8:29am UTC](https://discuss.kotlinlang.org/t/compilation-using-2-3-0-hangs/30908 "2026-04-15T08:29:24Z")

</div>

I upgraded to 2.3.0 in my Gradle build today, and now compilation does not finish (or at least is taking so much longer than with 2.2.21 that I am not willing to wait for it to finish). Adding kotlin.compiler.execution.…

---

## [Kotlin-rate-limiter](https://discuss.kotlinlang.org/t/kotlin-rate-limiter/31032)

<div class="topic-metadata">

**Author:** [@delder004](https://discuss.kotlinlang.org/u/delder004)\
**Replies:** 0\
**Last updated:** [April 14, 2026, 12:02am UTC](https://discuss.kotlinlang.org/t/kotlin-rate-limiter/31032 "2026-04-14T00:02:02Z")

</div>

Looking for feedback and users! I built a small library in this space that may be useful as a reference implementation: https://github.com/delder004/kotlin-rate-limiter It’s a coroutine-native rate limiter for outbound…

---

## [Kotlin Manual Testing](https://discuss.kotlinlang.org/t/kotlin-manual-testing/31027)

<div class="topic-metadata">

**Author:** [@balakrishnanultra01](https://discuss.kotlinlang.org/u/balakrishnanultra01)\
**Replies:** 2\
**Last updated:** [April 11, 2026, 3:53am UTC](https://discuss.kotlinlang.org/t/kotlin-manual-testing/31027 "2026-04-11T03:53:22Z")

</div>

I am contributing the Kotlin Compiler Fuzzer(Kai) in Google summer of code. i want test kotlin language features and build in method. my aim is, i am one of the part of kotlin programming language development. if any …

---

## [Null-safety and initialization order](https://discuss.kotlinlang.org/t/null-safety-and-initialization-order/27616)

<div class="topic-metadata">

**Author:** [@dsh2](https://discuss.kotlinlang.org/u/dsh2)\
**Replies:** 15\
**Last updated:** [April 1, 2026, 2:40pm UTC](https://discuss.kotlinlang.org/t/null-safety-and-initialization-order/27616 "2026-04-01T14:40:31Z")

</div>

Dear community, what have I understood wrong about null-safety, if I’m surprised that the following code is causing a NullPointerException? (cf. play.kotlinlang.org/) class DelusiveNullSafety { init { accessProper…

---

## [Feature request / discussion: “Thin” Kotlin/Native Apple frameworks (shared runtime/deps; non-self-contained framework)](https://discuss.kotlinlang.org/t/feature-request-discussion-thin-kotlin-native-apple-frameworks-shared-runtime-deps-non-self-contained-framework/31018)

<div class="topic-metadata">

**Author:** [@jinwei.han93](https://discuss.kotlinlang.org/u/jinwei.han93)\
**Replies:** 0\
**Last updated:** [March 30, 2026, 10:50pm UTC](https://discuss.kotlinlang.org/t/feature-request-discussion-thin-kotlin-native-apple-frameworks-shared-runtime-deps-non-self-contained-framework/31018 "2026-03-30T22:50:48Z")

</div>

Context Hi Kotlin team and community, We are using Kotlin Multiplatform with Kotlin/Native to build and ship Apple frameworks (XCFrameworks) for a large modularized codebase. We want to split our deliverables into two …

---

## [Date && simpledateformat](https://discuss.kotlinlang.org/t/date-simpledateformat/31001)

<div class="topic-metadata">

**Author:** [@gunsailor66](https://discuss.kotlinlang.org/u/gunsailor66)\
**Replies:** 6\
**Last updated:** [March 24, 2026, 10:07pm UTC](https://discuss.kotlinlang.org/t/date-simpledateformat/31001 "2026-03-24T22:07:05Z")

</div>

hello there! i try to implement a simple UTC time for all the world… I thought i had succeed. But recently i updated from panda 1 to panda 2 ( android studio ) and my code doesn’t work anymore. Here is a simple code t…

---

## [Moving from suspend function to blocking code on JVM](https://discuss.kotlinlang.org/t/moving-from-suspend-function-to-blocking-code-on-jvm/30985)

<div class="topic-metadata">

**Author:** [@benjishults](https://discuss.kotlinlang.org/u/benjishults)\
**Replies:** 17\
**Last updated:** [March 13, 2026, 2:51pm UTC](https://discuss.kotlinlang.org/t/moving-from-suspend-function-to-blocking-code-on-jvm/30985 "2026-03-13T14:51:12Z")

</div>

Looking for feedback. I’ve written this code for JVM that will suspend a coroutine when it calls code that blocks on IO from a suspend function but without blocking the suspend function’s host thread. My goals: meant…

---

## [A good approach for dynamically loading and recompiling 3rd-party projects](https://discuss.kotlinlang.org/t/a-good-approach-for-dynamically-loading-and-recompiling-3rd-party-projects/30990)

<div class="topic-metadata">

**Author:** [@fish](https://discuss.kotlinlang.org/u/fish)\
**Replies:** 0\
**Last updated:** [March 11, 2026, 8:06am UTC](https://discuss.kotlinlang.org/t/a-good-approach-for-dynamically-loading-and-recompiling-3rd-party-projects/30990 "2026-03-11T08:06:20Z")

</div>

I’m trying to make an animation framework in Kotlin, similar to Motion Canvas, but using Kotlin coroutines instead of JS generator functions. It runs on the JVM, since it uses Compose Desktop for all the state tracking a…

---

## [Kotlin incorrectly uses getters for private fields in open classes](https://discuss.kotlinlang.org/t/kotlin-incorrectly-uses-getters-for-private-fields-in-open-classes/30981)

<div class="topic-metadata">

**Author:** [@MooingDuck](https://discuss.kotlinlang.org/u/MooingDuck)\
**Replies:** 2\
**Last updated:** [March 6, 2026, 7:02pm UTC](https://discuss.kotlinlang.org/t/kotlin-incorrectly-uses-getters-for-private-fields-in-open-classes/30981 "2026-03-06T19:02:42Z")

</div>

@InternalState open class ImmutableIntIntArrayMap { private val map: LongArray @Cache private var lastEntryIndex = 0 ... @Pure fun getLastEntry() = Entry(map\[lastEntryIndex\]) } My code is using a Purity ch…

---

## [Ktor and KMP threads](https://discuss.kotlinlang.org/t/ktor-and-kmp-threads/30983)

<div class="topic-metadata">

**Author:** [@AppL](https://discuss.kotlinlang.org/u/AppL)\
**Replies:** 0\
**Last updated:** [March 6, 2026, 6:48am UTC](https://discuss.kotlinlang.org/t/ktor-and-kmp-threads/30983 "2026-03-06T06:48:56Z")

</div>

How to determine whether my KMP application was closed properly? I mean I am using multiple coroutines in my KMP for desktop application mainly for Ktor receive bytes function but when I close the app I can see instances…

---

## [Sequences and Inlined Lambdas](https://discuss.kotlinlang.org/t/sequences-and-inlined-lambdas/17228)

<div class="topic-metadata">

**Author:** [@derektom14](https://discuss.kotlinlang.org/u/derektom14)\
**Replies:** 26\
**Last updated:** [March 5, 2026, 7:29pm UTC](https://discuss.kotlinlang.org/t/sequences-and-inlined-lambdas/17228 "2026-03-05T19:29:10Z")

</div>

Suppose you want to do the very common operation of applying a filter and a mapping to a list, and you want the code to be very efficient. The most obvious first solution is to write: val processedItemNames = items …

---

## [Audio output from multiple Web Views simultaneously](https://discuss.kotlinlang.org/t/audio-output-from-multiple-web-views-simultaneously/30982)

<div class="topic-metadata">

**Author:** [@marc](https://discuss.kotlinlang.org/u/marc)\
**Replies:** 0\
**Last updated:** [February 28, 2026, 10:24pm UTC](https://discuss.kotlinlang.org/t/audio-output-from-multiple-web-views-simultaneously/30982 "2026-02-28T22:24:36Z")

</div>

Hi, When I add two Web Views with audio to an activity, it seems like Android will only play the audio from one Web View at a time. Is it possible to hear the audio output from both web views simultaneously? Best regar…

---

## [(x) -\> Any? returns kotlin.unit when invoked](https://discuss.kotlinlang.org/t/x-any-returns-kotlin-unit-when-invoked/30980)

<div class="topic-metadata">

**Author:** [@unname360l](https://discuss.kotlinlang.org/u/unname360l)\
**Replies:** 6\
**Last updated:** [February 28, 2026, 12:29pm UTC](https://discuss.kotlinlang.org/t/x-any-returns-kotlin-unit-when-invoked/30980 "2026-02-28T12:29:20Z")

</div>

class Where( val column: String, var value: Any?, val condition: String? = null, ) : IWhere { override fun clone(): Where { val clone = Where(column, value, condition) if(::callback.isIni…

---

## [Bug in 'Where'?](https://discuss.kotlinlang.org/t/bug-in-where/30979)

<div class="topic-metadata">

**Author:** [@man85](https://discuss.kotlinlang.org/u/man85)\
**Replies:** 6\
**Last updated:** [February 26, 2026, 5:58am UTC](https://discuss.kotlinlang.org/t/bug-in-where/30979 "2026-02-26T05:58:11Z")

</div>

interface TypeSafeService\<MARKER : Marker\<\*\>\> { fun \<T : Any, F\> getObject( objClass: KClass\<F\> ): T where F: Marker\<T\>, F: MARKER } interface Marker\<T: Any\> { fun markerType() : KClass\<T\> } I n…

---

## [Is this a common Kotlin scratch issue](https://discuss.kotlinlang.org/t/is-this-a-common-kotlin-scratch-issue/30965)

<div class="topic-metadata">

**Author:** [@Neeraj\_Sharma](https://discuss.kotlinlang.org/u/Neeraj_Sharma)\
**Replies:** 1\
**Last updated:** [February 23, 2026, 1:22pm UTC](https://discuss.kotlinlang.org/t/is-this-a-common-kotlin-scratch-issue/30965 "2026-02-23T13:22:41Z")

</div>

Am I alone getting this?? I was not able to run the sratch file. :sweat\_smile: Compilation failed: error: error processing script definition class org.jetbrains.kotlin.idea.core.script.k2.definitions.KotlinScratchScript…

---

## [Pattern matching in Kotlin](https://discuss.kotlinlang.org/t/pattern-matching-in-kotlin/598)

<div class="topic-metadata">

**Author:** [@kenbarc](https://discuss.kotlinlang.org/u/kenbarc)\
**Replies:** 11\
**Last updated:** [February 21, 2026, 9:00pm UTC](https://discuss.kotlinlang.org/t/pattern-matching-in-kotlin/598 "2026-02-21T21:00:55Z")

</div>

The past year I have evolved a simple pattern matching scheme that I now automatically incorporate into new Kotlin class hierarchies. The scheme is trivial to include, costs nothing to program and offers some beneficial …

---

## [Coroutine cancelling](https://discuss.kotlinlang.org/t/coroutine-cancelling/30964)

<div class="topic-metadata">

**Author:** [@Mike\_Bray](https://discuss.kotlinlang.org/u/Mike_Bray)\
**Replies:** 7\
**Last updated:** [February 20, 2026, 4:36pm UTC](https://discuss.kotlinlang.org/t/coroutine-cancelling/30964 "2026-02-20T16:36:48Z")

</div>

I have an app with 2 background tasks. The main app communicates with these via LinkedBlockingQueues. Tasks to be executed are put on the appropriate queue. The background tasks wait on these queues. When they receive…

---

## [Java 25 compatibility](https://discuss.kotlinlang.org/t/java-25-compatibility/30760)

<div class="topic-metadata">

**Author:** [@cunhazera](https://discuss.kotlinlang.org/u/cunhazera)\
**Replies:** 10\
**Last updated:** [February 20, 2026, 4:32pm UTC](https://discuss.kotlinlang.org/t/java-25-compatibility/30760 "2026-02-20T16:32:57Z")

</div>

Any plans to support Java 25 now that gradle has released 9.1.0 with full support?

---

## [Native on STM32 with very limited RAM and code space](https://discuss.kotlinlang.org/t/native-on-stm32-with-very-limited-ram-and-code-space/30968)

<div class="topic-metadata">

**Author:** [@fish](https://discuss.kotlinlang.org/u/fish)\
**Replies:** 0\
**Last updated:** [February 19, 2026, 9:53am UTC](https://discuss.kotlinlang.org/t/native-on-stm32-with-very-limited-ram-and-code-space/30968 "2026-02-19T09:53:44Z")

</div>

I’m somewhat interested in trying to get KN running on Pebble hardware (stm32 CPU, 128k max code + heap size at most for only one model, 64k has better support). Is this even feasible? These are the arguments C files ge…

---

## [Does not recompose when global MutableState is not in MainActivity.kt](https://discuss.kotlinlang.org/t/does-not-recompose-when-global-mutablestate-is-not-in-mainactivity-kt/30967)

<div class="topic-metadata">

**Author:** [@Megadash452](https://discuss.kotlinlang.org/u/Megadash452)\
**Replies:** 5\
**Last updated:** [February 18, 2026, 6:45pm UTC](https://discuss.kotlinlang.org/t/does-not-recompose-when-global-mutablestate-is-not-in-mainactivity-kt/30967 "2026-02-18T18:45:14Z")

</div>

I am working on an Android app with Jetpack Compose. Here I need to load data (a list of strings) from the app’s storage to display in a LazyColumn, and allow this list to be updated based on user interaction. Essentiall…

---

## [Kotlin vs. modern Java](https://discuss.kotlinlang.org/t/kotlin-vs-modern-java/26859)

<div class="topic-metadata">

**Author:** [@medium](https://discuss.kotlinlang.org/u/medium)\
**Replies:** 51\
**Last updated:** [February 17, 2026, 9:41am UTC](https://discuss.kotlinlang.org/t/kotlin-vs-modern-java/26859 "2026-02-17T09:41:29Z")

</div>

Some years back Kotlin was an easy sell, because Java (lets say up to Java 9) felt dated and was inconvenient in many regards. But Oracle invested a lot to make Java more attractive. Recent Java features: Local type in…

---

## [My KMP wasmjs app causes GPU resets](https://discuss.kotlinlang.org/t/my-kmp-wasmjs-app-causes-gpu-resets/30962)

<div class="topic-metadata">

**Author:** [@luc5000luc](https://discuss.kotlinlang.org/u/luc5000luc)\
**Replies:** 0\
**Last updated:** [February 14, 2026, 9:07pm UTC](https://discuss.kotlinlang.org/t/my-kmp-wasmjs-app-causes-gpu-resets/30962 "2026-02-14T21:07:56Z")

</div>

I create an app using Kotlin Multiplatform, compiled to wasmjs, simple app to practice touch typing, basically I display letters on a canvas, nothing more. I noticed yesterday blackouts, for a few seconds, but then, th…

---

## [Null-safe Nested Map Navigation](https://discuss.kotlinlang.org/t/null-safe-nested-map-navigation/6935)

<div class="topic-metadata">

**Author:** [@sohrab](https://discuss.kotlinlang.org/u/sohrab)\
**Replies:** 3\
**Last updated:** [February 13, 2026, 10:22am UTC](https://discuss.kotlinlang.org/t/null-safe-nested-map-navigation/6935 "2026-02-13T10:22:22Z")

</div>

Is there an idiomatic way of doing null-safe navigation through nested maps? I am trying to move our guys to Kotlin from a lot of Groovy transformations involving JSONs (and no POJOs/POGOs/Data classes). So far it was n…

---

## [Braces : block code and lambda confusion](https://discuss.kotlinlang.org/t/braces-block-code-and-lambda-confusion/30954)

<div class="topic-metadata">

**Author:** [@sylvainspinelli](https://discuss.kotlinlang.org/u/sylvainspinelli)\
**Replies:** 9\
**Last updated:** [February 12, 2026, 8:20am UTC](https://discuss.kotlinlang.org/t/braces-block-code-and-lambda-confusion/30954 "2026-02-12T08:20:23Z")

</div>

Starting with this example: class A { var prop: A? = null fun doX() { if(prop!=null) prop!!.print() else println("prop is null") } fun print(){ println("...") } } We are trying to eliminate the use of !! (…

[Previous page](https://discuss.kotlinlang.org/latest.md)

[Next page](https://discuss.kotlinlang.org/latest.md?page=2)
