https://kotlinlang.org logo
Docs
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
random
  • m

    magnumrocha

    03/21/2022, 9:15 AM
    I would like to give kudos to the JetBrains team to the amazing work on the Kotlin Documentation website: https://kotlinlang.org/docs 💪 Now, one of my hobbies is to read this amazing documentation and sharp my knowledge on Kotlin world 😊
    ➕ 8
    ❤️ 3
    o
    1 reply · 2 participants
  • u

    ursus

    03/22/2022, 12:31 AM
    Does anyone here use stacked pull requests? What’s been your experience? Worth the hassle?
    t
    c
    8 replies · 3 participants
  • c

    christophsturm

    03/22/2022, 2:09 PM
    does anyone know how i can detect the cpu architecture in kotlin/jvm? i don’t want the jvm architecture, i want to detect arm even when i run on an intel jvm via rosetta.
    e
    k
    +1
    12 replies · 4 participants
  • t

    Tim Malseed

    03/23/2022, 11:36 PM
    Does anyone know where I might find some Compose or Android merch, in Australia?
    t
    6 replies · 2 participants
  • p

    Philipp Mayer

    03/25/2022, 10:00 AM
    Out of curiosity, what naming conventions do you use for files containing only a function? Eg. I have a file that is basically a factory function declared as extension function of some domain object:
    data class MyDomainObject(val message: String)
    
    //some adapter package
    data class MyResponse(val localizedMessage: String)
    
    fun MyDomainObject.toMyResponse(locale: Locale) : MyResponse {
        /*    imagine a lot of mapping here, calling other pure functions in the same file     */
        
        return MyResponse(this.message + locale.toString())
    }
    It’s a complex object, so placing the extension function inside the
    MyResponse
    file would hinder readability. I couldn’t really find anything regarding that in the kotlin docs. What’s your take on it? I would love to hear different opinions!
    s
    r
    +7
    22 replies · 10 participants
  • m

    magnumrocha

    03/31/2022, 8:49 AM
    JetBrains any channel here regarding Fleet updates?
    m
    2 replies · 2 participants
  • a

    Alex

    03/31/2022, 10:40 AM
    Hi all, I would like to improve this by removing mutable vars here, but I’m kind of struggling with finding a way to do so. Any ideas?
    f
    i
    +1
    11 replies · 4 participants
  • r

    rtsketo

    03/31/2022, 4:55 PM
    open class A {
        open fun somFun(lambda: (suspend A.() -> Unit)? = null) = apply { /* ... */ } 
    }
    
    class B : A()
    
    class C {
        /**
         * Type mismatch.
         *  Required: B
         *  Found: A
         */
        val b: B = B().somFun { }
    }
    Is there a way to return B instead of A in
    B().somFun { }
    without using a static function like below?
    open class A {
        companion object {
            fun <T : A> T.somFun(lambda: (suspend T.() -> Unit)? = null) = apply { /* ... */ }
        }
    }
    Like, is there a way to have <out A> in a lambda?
    e
    1 reply · 2 participants
  • s

    Slackbot

    04/01/2022, 7:33 AM
    This message was deleted.
    ❓ 1
    r
    t
    +1
    3 replies · 4 participants
  • j

    Jason5lee

    04/02/2022, 2:07 PM
    I found that in Java, I can use a Kotlin internal class from a Gradle dependency. Is it expected behavior?
    :kotlin-intensifies: 1
    f
    e
    3 replies · 3 participants
  • t

    therealbluepandabear

    04/03/2022, 3:45 AM
    Random question: anyone know any good frameworks for doing Minecraft modding with Kotlin?
    r
    1 reply · 2 participants
  • s

    Slackbot

    04/06/2022, 5:15 AM
    This message was deleted.
    b
    1 reply · 2 participants
  • s

    suresh

    04/06/2022, 5:07 PM
    https://twitter.com/mreinhold/status/1511738590753005572
    🎉 1
    r
    f
    +4
    19 replies · 7 participants
  • p

    pablisco

    04/08/2022, 11:13 AM
    Oof: https://twitter.com/pablisc0/status/1512387114398322688
    ❓ 1
    k
    i
    +2
    9 replies · 5 participants
  • s

    samp

    04/09/2022, 4:14 PM
    I have this kind of implementation but it’s not allowed after bumping Kotlin to 1.6.10 and received the following error which was warning until previous version. Code:
    sealed class PowerTool(
        @JvmField open val name: String,
        @JvmField open val price: Double
    ) {
        data class CircularSaw(
            val diameter: Int,
            val cordless: Boolean,
            override val name: String,
            override val price: Double
        ) : PowerTool(name, price)
    
        data class DrillPress(
            val rpm: Int,
            override val name: String,
            override val price: Double
        ) : PowerTool(name, price)
    }
    Error: JvmField can only be applied to final property
    My requirement for jvm field is: I need @JvmField for java consumers as I don’t want to refactor the code to use the setter/getter method and want to use as a field. Any thoughts?
    b
    l
    +1
    10 replies · 4 participants
  • j

    Jason5lee

    04/12/2022, 2:52 AM
    Ask who constantly uses both JetBrains IDE and VSCode: what key map do you use? Do you use a JB key map on VSCode or VSCode key map on JB? Or do you use a specific key map like Vim on both? Or do you just use the default key map and get used to switching key map mindset between them?
    b
    e
    +1
    3 replies · 4 participants
  • s

    sindrenm

    04/12/2022, 1:46 PM
    Today I learned that a public inline function can't call a private inline function, and it's driving me mad.
    inline fun foo() = bar() // does not compile
    private inline fun bar() {}
    a
    r
    7 replies · 3 participants
  • j

    Jason5lee

    04/15/2022, 3:15 PM
    GitHub Copilot taught me derivative.
    😄 3
    e
    t
    2 replies · 3 participants
  • c

    Chaiwa Berian

    04/16/2022, 4:20 PM
    Hey here. Anyone with a good pointer for how to model json objects(api response) with a lot of fields that you do not need, in Android? The api is returning a lot of fields and there is no way to exclude those fields at the api level. Any ideas?
    u
    1 reply · 2 participants
  • o

    oshai

    04/20/2022, 1:07 PM
    am I the only one thinks that context receivers is not a good idea (makes the code harder to follow) ? Is there anywhere to vote against it?
    👆 1
    :yes: 1
    r
    r
    +3
    14 replies · 6 participants
  • t

    therealbluepandabear

    04/21/2022, 5:53 AM
    Does anyone have any good, solid code examples where you'd use a context receiver over an extension function?
    r
    4 replies · 2 participants
  • t

    therealbluepandabear

    04/21/2022, 5:57 AM
    I know it's just a preview, but this just looks horribly messy and hard to understand:
    :thread-please: 1
    b
    2 replies · 2 participants
  • f

    Francis Mariano

    04/25/2022, 12:57 PM
    hello folks. How is the adoption of Kotlin in cryptocurrency universe?
    t
    1 reply · 2 participants
  • d

    darkmoon_uk

    04/27/2022, 2:41 AM
    🎊 I just want to give a big shout out to @ephemient 🎊 You are, so often, bringing solid and quick answers to even the most esoteric questions. Thanks for being a pillar of the community with god-like knowledge of Kotlin and JVM engineering! Your employer must be lucky 👍
    👏 5
    👨‍🔬 3
    ➕ 19
    :yes: 3
    :kotlin-intensifies: 1
    👍🏼 1
    r
    l
    2 replies · 3 participants
  • s

    Sam

    04/28/2022, 8:42 AM
    Question from a colleague: was "koroutines" ever considered as a name for Kotlin coroutines? 😄
    😅 3
    a
    r
    +1
    3 replies · 4 participants
  • t

    therealbluepandabear

    05/03/2022, 2:03 AM
    Spotted another Kotlin logo today 🤣 :
    :kotlin-intensifies: 2
    👍🏼 1
    r
    1 reply · 2 participants
  • c

    Colton Idle

    05/06/2022, 4:33 PM
    For you android app developers. How does you version and automate app deployments? Essentially I'm facing some analysis paralysis: 1. Manually tag a release as new version 1.0.1, then the same dev presses a button to kickoff CI look for the last tag. and create a build. send it to firebase app distrubition. or 2. have a CI job that a dev invokes, and it adds a tag itself and then creates a build to shipoff to firebase app dist. I guess I'm getting caught up on what is the "operation" that signifies a new release of the app. and of course it would be super nice to have it automated. which is why optino 1 kinda feels "wrong" because the user has to manually tag and bump versions. but maybe thats just a fact of life. the con of option 2 is that the CI creates a build and will also make the PR for the version bumps, but it technically happens after the release is sent. idk. We have option 2 implemented. and its nice. but i think option 1 is actually better?
    r
    e
    +2
    5 replies · 5 participants
  • r

    rtsketo

    05/12/2022, 11:29 AM
    How would you call a call that succeeded but with a warning, in one word?
    a
    k
    +4
    14 replies · 7 participants
  • c

    Colton Idle

    05/13/2022, 4:43 AM
    Random naming help. I have an android app. I need something that holds the overall app state. (i.e. Am I logged in, among other state) I'm torn between AppState and AppStateHolder. My coworker is vouching for AppManagerService. Thoughts?
    p
    a
    4 replies · 3 participants
  • j

    jmfayard

    05/13/2022, 4:05 PM
    Ever wandered if you could write Kotlin in a language other than english? I had some fun implementing foobar in esperanto https://pl.kotl.in/QxkY19BZV
    r
    k
    4 replies · 3 participants
Powered by Linen
Title
j

jmfayard

05/13/2022, 4:05 PM
Ever wandered if you could write Kotlin in a language other than english? I had some fun implementing foobar in esperanto https://pl.kotl.in/QxkY19BZV
r

rtsketo

05/13/2022, 4:23 PM
Well, I use
λυ
for
()->Unit
and
λ<Τ> for T.()->Unit
, does this count as Greek?
😄 1
👍 1
j

jmfayard

05/13/2022, 4:43 PM
Yes that looks good. Any links to people using mathematical symbols in kotlin?
k

Klitos Kyriacou

05/13/2022, 4:48 PM
I see you're using Τ instead of T. Very good! 🙂
r

rtsketo

05/14/2022, 8:53 AM
Impressive that you noticed something like this, but it was a typo after all (I had to check my code to be sure). Great idea nonetheless, I'm going to use greek letters for generics from now on 😛
View count: 1