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
announcements
  • b

    benleggiero

    07/27/2017, 12:03 PM
    Can anyone help me with this? https://stackoverflow.com/questions/45271471/why-wont-my-idea-projects-build
    k
    r
    13 replies · 3 participants
  • r

    ross_a

    07/27/2017, 3:18 PM
    Yo dawg, I heard you like annotations so I put an annotation on your annotation so you can annotate while you annotate
    j
    1 reply · 2 participants
  • p

    poohbar

    07/27/2017, 4:54 PM
    when I have some incoming platform type like so:
    val header = request.getHeader("xyz")
    I see that
    header
    has an inferred type of
    String!
    ... is this okay? what happens if
    getHeader
    returns
    null
    ?
    d
    3 replies · 2 participants
  • k

    kevin.cianfarini

    07/27/2017, 4:55 PM
    when im working in android studio and get an exception thrown, I get a Java stacktrace. Is there any way to get a kotlin stack trace?
    g
    1 reply · 2 participants
  • j

    jcarvalho

    07/27/2017, 9:58 PM
    Are there any Static Analysis tools available for Kotlin? Like Sonarqube or Coverity?
    k
    2 replies · 2 participants
  • a

    agomez

    07/27/2017, 10:00 PM
    https://blog.frankel.ch/sonarqube-plugin-kotlin/3/#gsc.tab=0
    😄 1
    k
    1 reply · 2 participants
  • k

    kevinherron

    07/27/2017, 10:00 PM
    does anybody know if Java 6 will remain a bytecode target in Kotlin 1.2?
    i
    v
    +2
    6 replies · 5 participants
  • p

    Paul Woitaschek

    07/28/2017, 6:02 AM
    What kind of youtrack?
    i
    2 replies · 2 participants
  • r

    rogeralsing

    07/28/2017, 10:35 AM
    The @JvmSynthetic can hide Kotlin things from Java. but is it possible to do the other way around? e.g. funcs that only exist to help a Java API but that shouldnt really be used from Kotlin
    d
    e
    6 replies · 3 participants
  • k

    karelpeeters

    07/28/2017, 5:51 PM
    But what does
    this
    refer to inside that method?
    d
    2 replies · 2 participants
  • k

    karelpeeters

    07/28/2017, 6:34 PM
    That method is also part of
    MutableList
    , so it should just work the same way.
    o
    3 replies · 2 participants
  • d

    diesieben07

    07/28/2017, 7:15 PM
    LinkedList doesn't help when you are doing an indexed add, you then have a different cost: traversing all the nodes.
    k
    1 reply · 2 participants
  • t

    tipsy

    07/28/2017, 7:19 PM
    any more elegant way of handling this?
    fun uploadedFile(fileName: String): UploadedFile? {
        val uploadedFiles = uploadedFiles(fileName)
        return if (uploadedFiles.isNotEmpty()) uploadedFiles[0] else null;
    }
    a
    2 replies · 2 participants
  • t

    tipsy

    07/28/2017, 7:39 PM
    are
    component1()
    ,
    component2()
    , etc supposed to be visible when using data-classes from java?
    a
    3 replies · 2 participants
  • d

    diesieben07

    07/28/2017, 10:40 PM
    It could not sensibly be implemented. Every
    Map
    implementation would have to implement
    filter
    .
    a
    5 replies · 2 participants
  • c

    cdurham

    07/28/2017, 10:52 PM
    if you really want to ensure the return type can you use
    filterTo
    ?
    👆 1
    d
    a
    12 replies · 3 participants
  • c

    crypto

    07/29/2017, 7:27 AM
    something like "import kotlinx.coroutines.experimental.[CommonPool, Job, delay, launch]"
    k
    1 reply · 2 participants
  • r

    rogeralsing

    07/29/2017, 9:31 AM
    Ah, I could add an default method to the interface calling into the extension
    d
    1 reply · 2 participants
  • f

    feroz_baig

    07/29/2017, 1:30 PM
    Realm vs sqlbrite vs Room vs GreenDao vs dbflow vs Requery Among these I've used only Realm which is Object oriented in nature. Others are Relational Db based. Im looking for a SQLite based library to simplify code. If youre familiar with most of them, please share your opinions.
    p
    2 replies · 2 participants
  • s

    supaham

    07/29/2017, 1:51 PM
    val componentArgs: List<Pair<Int, Component>> = args
            .mapIndexed { idx, it -> idx to it }
            .filter { it.second is Component }
            .map { it.first to it.second as Component }
    Is there a neater way of writing this? I want to store index to args value only if it is Component
    k
    6 replies · 2 participants
  • r

    redrield

    07/30/2017, 5:03 AM
    Returning it in getValue along with the proper value seems to be annoying because I can't destruct a Pair at the top level of the class
    k
    1 reply · 2 participants
  • b

    brucelee

    07/30/2017, 12:22 PM
    I am learning to use kotlin to build my application,but I've met some trouble ,here is my question: https://stackoverflow.com/questions/45397802/kotlin-start-application-crash?noredirect=1#comment77758059_45397802 . Is there any genius can help work this out?
    j
    1 reply · 2 participants
  • p

    pike

    07/31/2017, 12:18 AM
    Are there any chart libraries beside just JavaFx for kotlin?
    j
    2 replies · 2 participants
  • g

    gregopet

    07/31/2017, 8:26 AM
    It looks like a compiler bug to me, but I'm no expert - I'll reproduce this in a simple self-contained case and upload it somewhere
    k
    9 replies · 2 participants
  • m

    maciekjanusz

    07/31/2017, 11:32 AM
    is there a naming convention for kt files without classes?
    r
    1 reply · 2 participants
  • h

    havok

    07/31/2017, 1:40 PM
    I am trying to install Kotlin onn my ubuntu 16.04 using the instructions here https://www.cyberciti.biz/faq/how-to-install-kotlin-programming-language-on-ubuntudebian-linux/ I get the following: Stop! The archive was corrupt and has been removed! Please try installing again. Any suggestions
    g
    i
    13 replies · 3 participants
  • h

    havok

    07/31/2017, 3:17 PM
    assuming @ross_a comment towards me. I don't know, assuming this is a language with tools. I am not a java guy (cause it has always been cumbersome. Kotlin looked like it may solve some of that. Therefore wanted to download the language. No real instructions on the site kotlinlang.org for install that I saw.
    r
    4 replies · 2 participants
  • j

    joelpedraza

    07/31/2017, 4:29 PM
    @gildor found it. https://youtrack.jetbrains.com/issue/KT-15729
    g
    2 replies · 2 participants
  • s

    skennedy

    07/31/2017, 7:52 PM
    src/main/jakewharton
    😂 2
    ➕ 6
    n
    1 reply · 2 participants
  • o

    orangy

    07/31/2017, 8:02 PM
    I’m just using
    src
    ,
    test
    , etc. No main, no java or kotlin
    r
    m
    +3
    8 replies · 6 participants
Powered by Linen
Title
o

orangy

07/31/2017, 8:02 PM
I’m just using
src
,
test
, etc. No main, no java or kotlin
r

Ruckus

07/31/2017, 8:30 PM
Do you usually have
resources
as a top level directory as well?
m

michaelsims

07/31/2017, 8:38 PM
You madman! 😄
e

elect

07/31/2017, 9:10 PM
reasons?
e

Eugen Martynov

08/01/2017, 6:18 AM
He mostly is not writing android projects 🙂
o

orangy

08/01/2017, 7:54 AM
I have resources when needed, and I don't do Android. It's a lot simpler to manage and navigate, why not?
👍 1
e

Eugen Martynov

08/01/2017, 8:09 AM
With Android you usually deal with flavours, so you forced to have named subfolders in
src
Your approach is nice and clean, I just explained why it mostly will not work for android development
v

voddan

08/01/2017, 10:19 AM
no
main/
, no gain. Yay!
View count: 4