https://kotlinlang.org logo
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
announcements
  • d

    dave08

    10/10/2018, 12:56 PM
    Is there a way to have a
    List
    of a few different enums with a common property
    val
    ? I'd need to be able to retreive the list of entries and get the value of that property for each...
    m
    d
    d
    • 4
    • 30
  • s

    spierce7

    10/10/2018, 1:02 PM
    When are more Kotlinconf videos going to go up?
    e
    s
    • 3
    • 5
  • a

    andries.fc

    10/10/2018, 1:48 PM
    Hi @robstoll here is how I would do it.
    r
    m
    d
    • 4
    • 20
  • b

    Bernhard

    10/10/2018, 3:19 PM
    how do you feel about having different objects for writing and reading database objects? Writing an object will for instance not require an id whereas querying an object will always have one. Otherwise I have to add null checks everywhere.
    d
    t
    • 3
    • 46
  • p

    pakoito

    10/10/2018, 3:56 PM
    in 1.3, does the
    inline
    identifier ensure that the class will be inlined, or is it a hint and there any set of rules to which inline classes do get inlined
    d
    • 2
    • 2
  • s

    Shawn

    10/10/2018, 4:55 PM
    What are you trying to do?
    e
    • 2
    • 4
  • d

    David W

    10/10/2018, 7:25 PM
    How would I unit test an
    actor
    with a
    delay
    in it?
    -.kt
    d
    • 2
    • 9
  • o

    otakusenpai

    10/10/2018, 8:16 PM
    Hello, can i define a lambda that accepts a mutable variable as parameter?
    d
    s
    • 3
    • 10
  • j

    Janar

    10/11/2018, 6:00 AM
    Hi guys,
    fun foo(s: String = "") = "hello $s"
    
    fun bar(a: String?) {
       foo(a ?: "")
    }
    In the above code is there a way for us to use the default value for the parameter in case
    a
    is null, instead of repeating the default value in
    bar
    ? This way, we don’t rely on what the default value of
    foo
    is within
    bar
    s
    • 2
    • 3
  • b

    BMG

    10/11/2018, 8:10 AM
    inline fun <reified T> Config.xAxis(block: T.() -> Unit, axisType: AxisType) {
       xAxis = when (T::class.java) {
           NumericAxis::class.java -> {
             NumericAxis().apply(block)
           }
           else -> throw UnsupportedOperationException("currently unsupported")
       }
    }
    Why does it not compile? Any thoughts?
    m
    a
    +2
    • 5
    • 14
  • l

    legzo

    10/11/2018, 8:45 AM
    Hi guys, quick question : we are currently running Fortify [https://en.wikipedia.org/wiki/Fortify_Software] in our CI to check for potential vulnerability of our Java code. We plan to migrate some components to Kotlin but Fortify does'nt support Kotlin (yet?). Do you know something able to do a security audit on Kotlin code ?
    e
    m
    • 3
    • 6
  • j

    jcechace

    10/11/2018, 11:23 AM
    Hi, question about coroutines. I’m a bit confused about kolinx.couroutines vs kotlin.coroutines. What is the difference? docs (https://kotlinlang.org/docs/reference/coroutines-overview.html) are the former. Gradle kotlin-dsl example the later for example
    a
    s
    g
    • 4
    • 7
  • t

    Tsvetozar Bonev

    10/11/2018, 2:16 PM
    Anyone else having trouble with the #ktor dependency download? My CI can't pass because gradle takes times out before it can download it and the bintray links is very unresponsive.
    g
    • 2
    • 1
  • g

    ghedeon

    10/11/2018, 2:21 PM
    I might be missing something, but is there any way to binary search in a descending IntArray? All I can see is
    IntArray.binarySearch
    but that's only for ascending.
    Arrays.binarySearch
    allows you to specify the comparator but only for the
    Array<T>
    , not for the
    IntArray
    . Seems like a dead end.
    e
    r
    +2
    • 5
    • 22
  • r

    robstoll

    10/11/2018, 4:32 PM
    Looking at the byte code it seems like there is
    Array.copy
    involved in the following statement:
    fun foo(vararg path: String) = Paths.get(*path)
    Is there a way to pass an array to
    Paths.get
    as it is possible in Java in order to circumvent the performance penalty?
    r
    s
    o
    • 4
    • 11
  • e

    elect

    10/12/2018, 9:41 AM
    there isnt a way to have
    inline
    within
    interface
    methods?
    only private or final methods can have it
    k
    e
    e
    • 4
    • 17
  • j

    Jakub Gwóźdź

    10/12/2018, 2:09 PM
    one of the puzzlers from kotlinconf surprised me. why the unary
    -
    is not part of the number literal?
    fun main(args: Array<String>) {
        println(-2018.toString().length)
    }
    prints -4, because method call has higher priority than unaryMinus. I mean, I understand the reasoning for operators precedence and indeed it makes perfect sense to call the method before making any other operations. But in case of literals it would make much more sense to glue the minus char with the digits. Similarly as the dot between digits is not treated as a method call.
    m
    c
    • 3
    • 3
  • a

    arekolek

    10/12/2018, 2:16 PM
    what should
    println(4-2018.toString().length)
    print in your opinion?
    r
    d
    +4
    • 7
    • 14
  • j

    Jakub Gwóźdź

    10/12/2018, 2:34 PM
    Yeah I was really surprised by it as recently I was playing with some maths and had this
    data class Complex(val re: Double, val im: Double)
    nice class and a few operators on it and I was so happy that I can do all this
    z = z * z + c
    thingies, wow Kotlin is so great. Then I was sooooo happy when I figured out I can add
    val Double.i get() = Complex(0.0, this)
    and simply have
    val z = 3.5.i
    And then, just after that, I saw the "Puzzlers" talk. And tried
    -3.5.i
    . Oh boy...
    e
    • 2
    • 7
  • d

    digitalsanctum

    10/12/2018, 3:22 PM
    anyone know where the next KotlinConf will be hosted?
    🌐 5
    h
    p
    • 3
    • 3
  • m

    marcelo

    10/12/2018, 4:33 PM
    anyone using
    Spek
    for the unit tests in IntelliJ, not sure why I'm not able to run it. I installed the Spek Framework plugin.
    m
    m
    • 3
    • 2
  • j

    Jason

    10/12/2018, 6:06 PM
    Where can I post for an internship in Cape Town, South Africa we are offering?
    r
    • 2
    • 2
  • m

    McEna

    10/12/2018, 8:11 PM
    Hey guys, I've been searching but I can't find a clear answer. Can inline functions be recursive? I understand they can't, but I'd like to be sure
    d
    e
    +3
    • 6
    • 10
  • i

    Icaro Temponi

    10/12/2018, 8:33 PM
    Hi everybody, just would like to ask how stable is the last RC of version 1.3, I'm reaaaaaaaaallllly anxious to use it at production and omg, waiting is getting painful xD, really wanting to use release coroutines and with 1.3 i'll also start to delve into multiplatform projects and try to convince all my colleagues at work to migrate to this awesome language
    g
    • 2
    • 1
  • d

    Dominaezzz

    10/12/2018, 9:03 PM
    A heard a lot of mentions at KotlinConf of wanting a Kotlin/GPU back-end but isn't that already possible...ish? Kotlin/Native -> LLVM -> SPIR-V -> Vulkan/OpenCL.
    😲 1
    e
    k
    +2
    • 5
    • 11
  • p

    Paolo

    10/13/2018, 8:23 AM
    Hi guys, It is nice being part of this channel.
    👋 2
    k
    h
    • 3
    • 9
  • j

    jcechace

    10/13/2018, 5:59 PM
    Any tips for http client library? Fuel looks promising at first glance
    e
    n
    h
    • 4
    • 7
  • c

    claudiug

    10/13/2018, 8:03 PM
    hello everyone. Is kotlin coroutine suitable for processing big about of pdf parsing?
    e
    g
    • 3
    • 4
  • h

    Hamza

    10/14/2018, 4:52 AM
    What is the best way for working with files in kotlin? Do I still need to use FileInputStream and other classes from Java?
    k
    p
    +3
    • 6
    • 6
  • n

    Nikky

    10/14/2018, 6:02 PM
    anybody else getting this ? https://gist.github.com/NikkyAI/ae5f71181612dc9b2d76daf6d11f939a happens whenever i run something with gradlew, but not always when i run gradle tasks via idea it still compiles but this worries me
    a
    k
    d
    • 4
    • 8
Powered by Linen
Title
n

Nikky

10/14/2018, 6:02 PM
anybody else getting this ? https://gist.github.com/NikkyAI/ae5f71181612dc9b2d76daf6d11f939a happens whenever i run something with gradlew, but not always when i run gradle tasks via idea it still compiles but this worries me
a

Andreas Sinz

10/14/2018, 6:23 PM
Sounds more like a gradle question rather than a kotlin question
k

karelpeeters

10/14/2018, 6:23 PM
Because it is about the Kotlin deamon?
a

Andreas Sinz

10/14/2018, 6:26 PM
oh
n

Nikky

10/14/2018, 6:43 PM
i also asked the same in #gradle because i think it is related to gradle plugin dev.. where i am frced to use kotlin 1.2.61 while the rest of the modules use 1.2.71 (required by kotlinx.serialization)
d

Dico

10/15/2018, 11:56 AM
Is there a version discrepancy between the 2 Gradle versions?
n

Nikky

10/15/2018, 12:26 PM
not that i know of but there is a version discrepancy between the kotlin version bundled in gradle and the one used by the project
but i need to depend on the kotlin plugin in my plugin to set up dependencies, sourcesets etc
i assume with kt 1.3 i will no longer be forced to use a specific version for serialization plugin, then i can match the version gradle uses
View count: 3