# Latest

**URL:** https://discuss.kotlinlang.org/latest.md?no_subcategories=false&page=5

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

**Page:** 6

---

## [Error when compiling with K2JVMCompiler dynamically in Java](https://discuss.kotlinlang.org/t/error-when-compiling-with-k2jvmcompiler-dynamically-in-java/30744)

<div class="topic-metadata">

**Author:** [@John\_Fairhall](https://discuss.kotlinlang.org/u/John_Fairhall)\
**Replies:** 9\
**Last updated:** [September 10, 2025, 12:08am UTC](https://discuss.kotlinlang.org/t/error-when-compiling-with-k2jvmcompiler-dynamically-in-java/30744 "2025-09-10T00:08:25Z")

</div>

Hi, I am new to Kotlin. We are planning on using kotlin to run pluggable scripts, so I am trying to compile kotlin scripts in java and add to the available classes. My java code puts the script text to a file and runs …

---

## [Intellij plugin for Kotlin script definitions](https://discuss.kotlinlang.org/t/intellij-plugin-for-kotlin-script-definitions/30747)

<div class="topic-metadata">

**Author:** [@fish](https://discuss.kotlinlang.org/u/fish)\
**Replies:** 2\
**Last updated:** [September 8, 2025, 8:43pm UTC](https://discuss.kotlinlang.org/t/intellij-plugin-for-kotlin-script-definitions/30747 "2025-09-08T20:43:00Z")

</div>

I’m trying to make a plugin to add a custom script definition to IDEA. I’ve managed to make a script definition show up without any plugins if I have the project that contains the script definition loaded, but I’d like a…

---

## [Lsp + mcp](https://discuss.kotlinlang.org/t/lsp-mcp/30749)

<div class="topic-metadata">

**Author:** [@esafak](https://discuss.kotlinlang.org/u/esafak)\
**Replies:** 0\
**Last updated:** [September 4, 2025, 5:51pm UTC](https://discuss.kotlinlang.org/t/lsp-mcp/30749 "2025-09-04T17:51:10Z")

</div>

Has anyone used the Kotlin LSP with MCP?

---

## [Varargs with maps?](https://discuss.kotlinlang.org/t/varargs-with-maps/28224)

<div class="topic-metadata">

**Author:** [@PoolloverNathan](https://discuss.kotlinlang.org/u/PoolloverNathan)\
**Replies:** 4\
**Last updated:** [September 3, 2025, 11:29pm UTC](https://discuss.kotlinlang.org/t/varargs-with-maps/28224 "2025-09-03T23:29:37Z")

</div>

Is there a way to have something like Python’s \*\*kwargs? This is the syntax I want to use: fun makeTag(tagName: String, /\* vararg props: ??? \*/): Elem; makeTag("p", style = "color: red") This is the alternative I’m usi…

---

## [How to Compile Kotlin Code at Runtime from Java?](https://discuss.kotlinlang.org/t/how-to-compile-kotlin-code-at-runtime-from-java/30324)

<div class="topic-metadata">

**Author:** [@semenov.valentine](https://discuss.kotlinlang.org/u/semenov.valentine)\
**Replies:** 2\
**Last updated:** [September 2, 2025, 12:05am UTC](https://discuss.kotlinlang.org/t/how-to-compile-kotlin-code-at-runtime-from-java/30324 "2025-09-02T00:05:23Z")

</div>

Hey, I have a task where I need to compile Kotlin source code at runtime from within a Java application. Is kotlin-compiler-embeddable the recommended way to achieve this? For now, I am using K2JVMCompiler, but I’m not…

---

## [Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.9999, expected version is 1.7.1](https://discuss.kotlinlang.org/t/module-was-compiled-with-an-incompatible-version-of-kotlin-the-binary-version-of-its-metadata-is-1-9-9999-expected-version-is-1-7-1/30381)

<div class="topic-metadata">

**Author:** [@siegbertglodek](https://discuss.kotlinlang.org/u/siegbertglodek)\
**Replies:** 4\
**Last updated:** [September 1, 2025, 11:25am UTC](https://discuss.kotlinlang.org/t/module-was-compiled-with-an-incompatible-version-of-kotlin-the-binary-version-of-its-metadata-is-1-9-9999-expected-version-is-1-7-1/30381 "2025-09-01T11:25:49Z")

</div>

Hello everyone, despite hours of searching on Google and lots of try&error in Android Studio, I can’t find an explanation that I can understand as to where this error comes from and how I can fix it. I get this message…

---

## [Deconstruction with \* operator, similar to vararg](https://discuss.kotlinlang.org/t/deconstruction-with-operator-similar-to-vararg/30735)

<div class="topic-metadata">

**Author:** [@moddy\_te\_eni](https://discuss.kotlinlang.org/u/moddy_te_eni)\
**Replies:** 3\
**Last updated:** [August 31, 2025, 12:21pm UTC](https://discuss.kotlinlang.org/t/deconstruction-with-operator-similar-to-vararg/30735 "2025-08-31T12:21:35Z")

</div>

I often want to call functions with an object, but I need to specifiy the parameters explicitly: class Circle(val centerX: Int, val centerY: Int, val radius: Float) val point = IntOffset(100,200) val circle = Circle(p…

---

## [Support for "satisfies an interface"](https://discuss.kotlinlang.org/t/support-for-satisfies-an-interface/30736)

<div class="topic-metadata">

**Author:** [@luigialice](https://discuss.kotlinlang.org/u/luigialice)\
**Replies:** 18\
**Last updated:** [August 30, 2025, 9:48pm UTC](https://discuss.kotlinlang.org/t/support-for-satisfies-an-interface/30736 "2025-08-30T21:48:35Z")

</div>

I want to write a function, that accepts any argument that just fullfills or satisfies an interface. E.g. My example interface Inf1 has an open() and a close() method. fun myFun(arg: satisfies Inf1) {arg.open(); … arg.…

---

## [Comparison operators in when expressions](https://discuss.kotlinlang.org/t/comparison-operators-in-when-expressions/30180)

<div class="topic-metadata">

**Author:** [@martin.haeusler](https://discuss.kotlinlang.org/u/martin.haeusler)\
**Replies:** 6\
**Last updated:** [August 30, 2025, 1:13pm UTC](https://discuss.kotlinlang.org/t/comparison-operators-in-when-expressions/30180 "2025-08-30T13:13:27Z")

</div>

I’m aware that I’m not the first person to bring this up, but all discussions on the matter I’ve found are several years old. When writing a when statement, it’s often the case that we’re dealing with numeric values (or…

---

## [DateTime design probably needs a rework](https://discuss.kotlinlang.org/t/datetime-design-probably-needs-a-rework/30411)

<div class="topic-metadata">

**Author:** [@alessio.zamboni](https://discuss.kotlinlang.org/u/alessio.zamboni)\
**Replies:** 1\
**Last updated:** [August 30, 2025, 12:49pm UTC](https://discuss.kotlinlang.org/t/datetime-design-probably-needs-a-rework/30411 "2025-08-30T12:49:04Z")

</div>

Kotlin doesn’t provide in the stdlib any support for datetime operations, even if in most real-world applications this datatype is very much used. To perform computations, you need to download an external dependency and …

---

## [Kotlin doesn't play nice with Beans Validation annotations and this needs to be addressed](https://discuss.kotlinlang.org/t/kotlin-doesnt-play-nice-with-beans-validation-annotations-and-this-needs-to-be-addressed/27761)

<div class="topic-metadata">

**Author:** [@martin.haeusler](https://discuss.kotlinlang.org/u/martin.haeusler)\
**Replies:** 6\
**Last updated:** [August 29, 2025, 12:32pm UTC](https://discuss.kotlinlang.org/t/kotlin-doesnt-play-nice-with-beans-validation-annotations-and-this-needs-to-be-addressed/27761 "2025-08-29T12:32:28Z")

</div>

Spring and Spring Boot are what I would call “kotlin-friendly” frameworks. However, the beans validation aspect specifically just doesn’t play nice with kotlin. Here’s why. Let’s assume the following data class: data c…

---

## [Feedback for my Pattern-Matching lib](https://discuss.kotlinlang.org/t/feedback-for-my-pattern-matching-lib/25180)

<div class="topic-metadata">

**Author:** [@Landei](https://discuss.kotlinlang.org/u/Landei)\
**Replies:** 11\
**Last updated:** [August 28, 2025, 11:42am UTC](https://discuss.kotlinlang.org/t/feedback-for-my-pattern-matching-lib/25180 "2025-08-28T11:42:14Z")

</div>

I’m writing a small library for “Scala-like” pattern-matching in when-expressions. It’s not ready yet (especially collections need some more love), and I’m looking for feedback and criticism. Here is how it can look like…

---

## [New(?) idea for collection literals](https://discuss.kotlinlang.org/t/new-idea-for-collection-literals/30728)

<div class="topic-metadata">

**Author:** [@benjishults](https://discuss.kotlinlang.org/u/benjishults)\
**Replies:** 3\
**Last updated:** [August 22, 2025, 8:20pm UTC](https://discuss.kotlinlang.org/t/new-idea-for-collection-literals/30728 "2025-08-22T20:20:29Z")

</div>

Typing this out from my phone so I haven’t tested the idea thoroughly but thought the idea maybe spark a good discussion. Collection literals will only be available when there is a “CollectionBuilder” in context. For e…

---

## [Let's have an intersection sugar](https://discuss.kotlinlang.org/t/lets-have-an-intersection-sugar/30697)

<div class="topic-metadata">

**Author:** [@link](https://discuss.kotlinlang.org/u/link)\
**Replies:** 3\
**Last updated:** [August 20, 2025, 3:44pm UTC](https://discuss.kotlinlang.org/t/lets-have-an-intersection-sugar/30697 "2025-08-20T15:44:42Z")

</div>

interface Developer { fun develop() } interface BeerExpert { fun drink() } fun \<T\> doAll(u: T) where T : Developer, T : BeerExpert { u.develop() u.drink() } // I wish that could be written as fun doAll(u: Dev…

---

## [Including custom files in JS library](https://discuss.kotlinlang.org/t/including-custom-files-in-js-library/26126)

<div class="topic-metadata">

**Author:** [@marcoeckstein](https://discuss.kotlinlang.org/u/marcoeckstein)\
**Replies:** 1\
**Last updated:** [August 20, 2025, 9:18am UTC](https://discuss.kotlinlang.org/t/including-custom-files-in-js-library/26126 "2025-08-20T09:18:10Z")

</div>

If you configure binaries.library() in js(IR), the build will produce build/productionLibrary/ with the files needed to publish the library to NPM. The package.json in it can be customized. However, NPM packages typicall…

---

## [Type Classes in Kotlin?](https://discuss.kotlinlang.org/t/type-classes-in-kotlin/410)

<div class="topic-metadata">

**Author:** [@BruceEckel](https://discuss.kotlinlang.org/u/BruceEckel)\
**Replies:** 5\
**Last updated:** [August 17, 2025, 6:57pm UTC](https://discuss.kotlinlang.org/t/type-classes-in-kotlin/410 "2025-08-17T18:57:20Z")

</div>

Does Kotlin support type classes in any way? If so, can someone point me to an example? Thanks!

---

## [Working with "Any" Variables Help](https://discuss.kotlinlang.org/t/working-with-any-variables-help/30695)

<div class="topic-metadata">

**Author:** [@vmercadolibretuc](https://discuss.kotlinlang.org/u/vmercadolibretuc)\
**Replies:** 1\
**Last updated:** [August 11, 2025, 5:26pm UTC](https://discuss.kotlinlang.org/t/working-with-any-variables-help/30695 "2025-08-11T17:26:10Z")

</div>

Hi friends, I have a query. I need the returned variable to print details and price term.details term.price but it won’t let me. It prints :printer:Product(details=Mouse Usb xxxx, price=3.25) another query. Is it okay t…

---

## [What is the safest file format to convert a large JSON file for use in Kotlin (android)?](https://discuss.kotlinlang.org/t/what-is-the-safest-file-format-to-convert-a-large-json-file-for-use-in-kotlin-android/30575)

<div class="topic-metadata">

**Author:** [@elpafras](https://discuss.kotlinlang.org/u/elpafras)\
**Replies:** 4\
**Last updated:** [August 14, 2025, 2:27am UTC](https://discuss.kotlinlang.org/t/what-is-the-safest-file-format-to-convert-a-large-json-file-for-use-in-kotlin-android/30575 "2025-08-14T02:27:26Z")

</div>

I have a large JSON file that I need to work with in a Kotlin (android) project. Due to its size, I’m considering converting it to a different file format for better performance or easier handling. What would be the saf…

---

## [listOf get index numbers](https://discuss.kotlinlang.org/t/listof-get-index-numbers/30699)

<div class="topic-metadata">

**Author:** [@mynixmail.fever](https://discuss.kotlinlang.org/u/mynixmail.fever)\
**Replies:** 2\
**Last updated:** [August 13, 2025, 5:45pm UTC](https://discuss.kotlinlang.org/t/listof-get-index-numbers/30699 "2025-08-13T17:45:27Z")

</div>

I am following this tutorial here. class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) enableEdgeToEdge() val p…

---

## [How many NoSuchFileException we expected?](https://discuss.kotlinlang.org/t/how-many-nosuchfileexception-we-expected/30680)

<div class="topic-metadata">

**Author:** [@cpdyj](https://discuss.kotlinlang.org/u/cpdyj)\
**Replies:** 2\
**Last updated:** [August 7, 2025, 7:17pm UTC](https://discuss.kotlinlang.org/t/how-many-nosuchfileexception-we-expected/30680 "2025-08-07T19:17:11Z")

</div>

I create a library to parse object and executable files. When the given file is not exists, I throw the my.NoSuchFileException. I think it’s good, because the file is really not exists. On JVM, since there’s a java.nio.…

---

## [How can set the scope for the output npm package (i.e. set the package name)?](https://discuss.kotlinlang.org/t/how-can-set-the-scope-for-the-output-npm-package-i-e-set-the-package-name/16335)

<div class="topic-metadata">

**Author:** [@Bradleycorn](https://discuss.kotlinlang.org/u/Bradleycorn)\
**Replies:** 3\
**Last updated:** [August 5, 2025, 10:47pm UTC](https://discuss.kotlinlang.org/t/how-can-set-the-scope-for-the-output-npm-package-i-e-set-the-package-name/16335 "2025-08-05T22:47:53Z")

</div>

I have a fairly standard Kotlin Multiplatform library project that produces library targets for android, jvm, and JavaScript. My project includes a single module, let’s call it ‘my-module’. When I assemble the project, I…

---

## [No remove Items in ArrayList](https://discuss.kotlinlang.org/t/no-remove-items-in-arraylist/30565)

<div class="topic-metadata">

**Author:** [@vmercadolibretuc](https://discuss.kotlinlang.org/u/vmercadolibretuc)\
**Replies:** 6\
**Last updated:** [August 4, 2025, 6:38am UTC](https://discuss.kotlinlang.org/t/no-remove-items-in-arraylist/30565 "2025-08-04T06:38:56Z")

</div>

Hey guys, I’m new to Kotlin and I’m practicing ArrayList. I can’t get it to delete the item I select. Can someone help me? Thanks a lot. package com.example.pruebas.oop.clases import kotlin.String class Producto (val…

---

## [Kotlin Playground share code error](https://discuss.kotlinlang.org/t/kotlin-playground-share-code-error/30662)

<div class="topic-metadata">

**Author:** [@ianindratama](https://discuss.kotlinlang.org/u/ianindratama)\
**Replies:** 0\
**Last updated:** [August 4, 2025, 4:02am UTC](https://discuss.kotlinlang.org/t/kotlin-playground-share-code-error/30662 "2025-08-04T04:02:32Z")

</div>

Hello. I am trying to share Kotlin playground code. However, the issue is the web unable to generate the share link. It seems that this issue is new because several days ago I try to share code via this and it works wel…

---

## [Why am I getting "Attempt to invoke virtual method 'java.io.FileInputStream android.content.Context.openFileInput(java.lang.String)' on a null object reference"](https://discuss.kotlinlang.org/t/why-am-i-getting-attempt-to-invoke-virtual-method-java-io-fileinputstream-android-content-context-openfileinput-java-lang-string-on-a-null-object-reference/30658)

<div class="topic-metadata">

**Author:** [@IS](https://discuss.kotlinlang.org/u/IS)\
**Replies:** 1\
**Last updated:** [August 3, 2025, 10:02am UTC](https://discuss.kotlinlang.org/t/why-am-i-getting-attempt-to-invoke-virtual-method-java-io-fileinputstream-android-content-context-openfileinput-java-lang-string-on-a-null-object-reference/30658 "2025-08-03T10:02:15Z")

</div>

Hello, I am developing an android application using Android Studios and Kotlin, and for this I made a helper class that helps me save data to an external file and load that data upon startup. This is a snapshot of the fu…

---

## [Android studio apps making error](https://discuss.kotlinlang.org/t/android-studio-apps-making-error/30621)

<div class="topic-metadata">

**Author:** [@bluemoon132](https://discuss.kotlinlang.org/u/bluemoon132)\
**Replies:** 1\
**Last updated:** [August 2, 2025, 7:07pm UTC](https://discuss.kotlinlang.org/t/android-studio-apps-making-error/30621 "2025-08-02T19:07:10Z")

</div>

file:///E:/SwipupYourfaceapps/app/build.gradle.kts:28:31: Unresolved reference: VERSION\_1\_6

---

## [How to preserve Context for whole Request with Spring webFlux and coroutines](https://discuss.kotlinlang.org/t/how-to-preserve-context-for-whole-request-with-spring-webflux-and-coroutines/30614)

<div class="topic-metadata">

**Author:** [@dineshmatrix675](https://discuss.kotlinlang.org/u/dineshmatrix675)\
**Replies:** 22\
**Last updated:** [July 30, 2025, 10:09am UTC](https://discuss.kotlinlang.org/t/how-to-preserve-context-for-whole-request-with-spring-webflux-and-coroutines/30614 "2025-07-30T10:09:56Z")

</div>

Context: Currently in my web application each request handled by each thread so to store logging context in whole application i use threadLocal which is initialised at start of request and flush logging data & reset at …

---

## [Rabbit Mq with Kotlin](https://discuss.kotlinlang.org/t/rabbit-mq-with-kotlin/11796)

<div class="topic-metadata">

**Author:** [@nitisharora](https://discuss.kotlinlang.org/u/nitisharora)\
**Replies:** 5\
**Last updated:** [July 29, 2025, 5:44pm UTC](https://discuss.kotlinlang.org/t/rabbit-mq-with-kotlin/11796 "2025-07-29T17:44:02Z")

</div>

Hi Guys, How can I integrate kotlin with rabbitmq?

---

## [\[SOLVED\] Improved exhaustiveness checks for when expressions with sealed classes﻿ in Kotlin 2.1.0](https://discuss.kotlinlang.org/t/solved-improved-exhaustiveness-checks-for-when-expressions-with-sealed-classes-in-kotlin-2-1-0/30622)

<div class="topic-metadata">

**Author:** [@Landei](https://discuss.kotlinlang.org/u/Landei)\
**Replies:** 5\
**Last updated:** [July 28, 2025, 4:42am UTC](https://discuss.kotlinlang.org/t/solved-improved-exhaustiveness-checks-for-when-expressions-with-sealed-classes-in-kotlin-2-1-0/30622 "2025-07-28T04:42:19Z")

</div>

My company code moved finally up to Kotlin 2.1.0 (yay!) and I wanted to give a quick demo of the new features. The else branch in when when it was logically not needed was always bothering me, so I’m glad there is some i…

---

## [Help with exception handling with getValue()](https://discuss.kotlinlang.org/t/help-with-exception-handling-with-getvalue/30610)

<div class="topic-metadata">

**Author:** [@vmercadolibretuc](https://discuss.kotlinlang.org/u/vmercadolibretuc)\
**Replies:** 6\
**Last updated:** [July 28, 2025, 12:37am UTC](https://discuss.kotlinlang.org/t/help-with-exception-handling-with-getvalue/30610 "2025-07-28T00:37:05Z")

</div>

I need to get the value of the Map, and handle exceptions, but I can’t find any examples, would someone be so kind? data class Product(val details:String?,val price:Double) val producTable = mutableMapOf\<Int,…

---

## [Coroutines and Weld RequestScope](https://discuss.kotlinlang.org/t/coroutines-and-weld-requestscope/9084)

<div class="topic-metadata">

**Author:** [@clecius](https://discuss.kotlinlang.org/u/clecius)\
**Replies:** 4\
**Last updated:** [July 25, 2025, 5:14pm UTC](https://discuss.kotlinlang.org/t/coroutines-and-weld-requestscope/9084 "2025-07-25T17:14:43Z")

</div>

Hi all, i’m working with kotlin coroutines and vert.x and it’s amazing, so simple, fast and lightweight. And as a Java developer, coming from JEE, i want to use CDI (Weld). In simple things it works fine, but when i tr…

[Previous page](https://discuss.kotlinlang.org/latest.md?no_subcategories=false&page=4)

[Next page](https://discuss.kotlinlang.org/latest.md?no_subcategories=false&page=6)
