aishwaryabhishek3
06/25/2025, 6:35 AM// Sealed class without generics
sealed class Result
// Subclass with a generic type
data class Success<T>(val data: T) : Result()
// Subclass without a generic type
object Loading : Result()
Or
sealed class Result<T>
class Success<T>(val data: T) : Result<T>()
// Some other subclass that doesn't need T can be defined as
class Error(val message: String) : Result<Nothing>()Manuel Lorenzo
07/09/2025, 1:40 PMCaleb B
07/09/2025, 11:55 PM"foo" in ("bar", "baz", "qux") instead of "foo" in listOf("bar, "baz", "qux") so it doesn't read as cluttered.
This one might actually be impossible since it would require fun (vararg T).contains, but it would be nice to do myList -= "x", "y", "z"Caleb B
07/10/2025, 12:01 AM=) with kotlin-assignment-plugin, but is there a way to do the same for is?
I love making DSLs. It's so much fun to screw with the language to make code more readable.Kev
08/03/2025, 7:57 AMdecision.first is a DecisionResult.Next without a manual class? Its not getting inferred for some reason.Amir H. Ebrahimnezhad
08/10/2025, 4:49 PMGeorgeS-Litesoft
08/20/2025, 5:59 PMZyle Moore
08/29/2025, 4:44 AMval properties. It's defined in a core module. I'm using it in a web module. Sometimes it can be smart-cast to its non-nullable version, but other times it can't. I thought that if I wrap usage in an if (nullableProp != null) { doSomethingWith(nullableProp.toString()) }, it would be safe, but it's not. Browsing for answers points to cases where it's a var, which could be reassigned between dereferencing calls. Or, the other module can be recompiled(?) and not be nullable anymore. But surely, a simple data class with `val`s is safe, right?
I was able to swap a `forEach`'s it with the deconstructed props, and it works fine then, so it seems like it's related to dereferencing it more than once, since deconstructing (having a single variable for the property) can smart cast, even though it's still a Public API in a different moduleHunter
09/15/2025, 5:08 PMunmmodifiableMap?Jeronimo Coello
09/16/2025, 12:53 AMbuild.gradle example that can compile and call an OpenAI or Anthropic agent with SpringBoot?
I’m attaching my current build.gradle, the service class I’m using, and the error I’m seeing.
Beyond this error, I’ve had several other dependency issues and tried different version combinations, but I haven’t managed to get a working example yet.
What I need right now is just a minimal build.gradle with up-to-date dependencies that lets me call an LLM successfully.
Thanks in advance! 🙏David Beer
09/25/2025, 12:13 PMrawUserData.select { cols(0..2) }.head(3) but the following doesn't `rawUserData.select { firstName and address.cols("city", "state")}.tail()`the compiler can't find the values firstName and insits on import some other address value.Marvin
09/26/2025, 12:09 PMJustin Tullgren
09/29/2025, 2:44 PMStephcraft
10/06/2025, 8:47 PMwindows-x86_64 on Windows 11 ARM 64?!
Is there anyway I can 'override' a property to allow this?
build.gradle.kts
plugins {
kotlin("multiplatform") version "2.2.20" // "2.0.0"
}
repositories {
mavenCentral()
}
kotlin {
// windows
mingwX64("native") {
binaries {
executable {
entryPoint = "main"
}
}
}
sourceSets {
val nativeMain by getting
}
}
Error:
Execution failed for task ':commonizeNativeDistribution'.
> Could not isolate value org.jetbrains.kotlin.gradle.targets.native.toolchain.NativeVersionValueSource$Params_Decorated@26bb7cb5 of type NativeVersionValueSource.Params
> Could not resolve all files for configuration ':kotlinNativeBundleConfiguration'.
> Failed to transform kotlin-native-prebuilt-2.2.20-windows-aarch64.zip (org.jetbrains.kotlin:kotlin-native-prebuilt:2.2.20) to match attributes {artifactType=zip, kotlin.native.bundle.type=DIRECTORY, org.gradle.status=release}.
> Could not find kotlin-native-prebuilt-2.2.20-windows-aarch64.zip (org.jetbrains.kotlin:kotlin-native-prebuilt:2.2.20).
Searched in the following locations:
<https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-native-prebuilt/2.2.20/kotlin-native-prebuilt-2.2.20-windows-aarch64.zip>
Possible solution:
- Declare repository providing the artifact, see the documentation at <https://docs.gradle.org/current/userguide/declaring_repositories.html>
References:
• https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-native-prebuilt/2.2.20/
• https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-compatibility-and-versioning.html#supported-platforms
• https://youtrack.jetbrains.com/issue/KT-68504/Kotlin-Native-mingwArm64-target-support
• https://youtrack.jetbrains.com/issue/KT-48420/Kotlin-Native-Support-win-arm64-hostVivek Modi
10/15/2025, 3:13 PMSlackbot
10/16/2025, 7:09 PMMax
10/19/2025, 11:50 AMAadarsh
10/21/2025, 5:52 AMShaun Wild
10/24/2025, 5:39 PMChris
10/28/2025, 9:34 AMmain and then I was presented with this:
Kotlin: kotlinc-jvm 1.8.20 (JRE 24.0.2+12)
Kotlin: [Internal Error] java.lang.NoSuchMethodError: 'org.jetbrains.kotlin.com.intellij.psi.PsiElement org.jetbrains.kotlin.resolve.lazy.data.KtClassLikeInfo.getScopeAnchor()'
at org.jetbrains.kotlinx.serialization.compiler.resolve.KSerializerDescriptorResolver.addSerializerImplClass(KSerializerDescriptorResolver.kt:75)
at org.jetbrains.kotlinx.serialization.compiler.extensions.SerializationResolveExtension.generateSyntheticClasses(SerializationResolveExtension.kt:78)
at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope.getNonDeclaredClasses(LazyClassMemberScope.kt:287)
Must be some sort of version mismatch but I didn't change the versions in the supplied build.gradle. Is this an issue with newer versions of IDEA?Shaun Wild
11/05/2025, 11:57 PMJack Eblan
11/06/2025, 8:46 AMspand
11/06/2025, 9:54 AM@LegacyApi . Can I create a super class ie. LegacyApiRequestHandler that "OptIn" on behalf of its subclasses ?Jovan
11/06/2025, 12:31 PMMap.entries.forEach
and
Map.forEach
Calling entries can be expensive, not sure if second example does the same behind?Rob Elliot
11/07/2025, 1:09 PMNana
11/09/2025, 7:55 PMGautamesh Zope
11/10/2025, 1:24 AMTalha Chaudhry
11/13/2025, 4:10 PMShaun Wild
11/16/2025, 3:49 PMAbhilash Mandaliya
11/17/2025, 4:52 PM