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
  • n

    nish

    06/24/2017, 3:55 AM
    Actually arm64 is a target in Kotlin-native right now
    n
    3 replies · 2 participants
  • s

    Slackbot

    06/24/2017, 11:03 AM
    This message was deleted.
    v
    2 replies · 2 participants
  • e

    erakitin

    06/24/2017, 6:08 PM
    Hi guys. I just tried to use
    1.1.3
    and got following error
    e: /Users/erakitin/Projects/android/wakiex/domain/build/tmp/kapt3/stubs/debug/com/wakie/wakiex/domain/model/users/profile/ProfileSettings.java:95: error: ')' expected
    e:
    
    e:     com.wakie.wakiex.domain.model.users.profile.DirectCallSetting directCallSetting, boolean p7_-314497661) {
    e:                                                                                                 ^
    e: /Users/erakitin/Projects/android/wakiex/domain/build/tmp/kapt3/stubs/debug/com/wakie/wakiex/domain/model/users/profile/ProfileSettings.java:95: error: illegal start of type
    e:
    It looks like there is an issue with naming in
    kapt
    1.1.2-5
    works fine.
    o
    2 replies · 2 participants
  • t

    tschuchort

    06/24/2017, 6:43 PM
    is there a function on collections that somehow mapsIndexed and filters at the same time? I need the indices of objects that have a specific property. I can't filter first because that would change the indices and I cant map first because then I lose the objects. Of course I could zip the objects with their original indices and then filter but I'd like to avoid that as kotlin doesn't have nice tuple syntax.
    d
    3 replies · 2 participants
  • j

    janvladimirmostert

    06/24/2017, 7:48 PM
    1.1.3 is nice, compile time with JRebel reduced from 10 seconds to around 3.5 seconds which is a huge improvement!
    🙂 1
    n
    4 replies · 2 participants
  • r

    redrield

    06/25/2017, 12:57 AM
    Couldn't find an android dancing with kotlin flags
    o
    1 reply · 2 participants
  • s

    shirbal

    06/25/2017, 8:47 AM
    Is there a way to define a c’tor which will look like this one instantiating (not specific use case, just playing with the language): var myclass = MyClass { propertyA = “Val1” propertyB = “val2" … }
    m
    t
    5 replies · 3 participants
  • w

    wouterdoeland

    06/25/2017, 11:54 AM
    I'm trying to upload a maven jar etc. to bintray. However, the sources jar is uploaded twice (which makes the build fail) this is my build xml: https://gist.github.com/anonymous/5bf0e30435389897e48e075b5c9a648a
    :stackoverflow: 2
    o
    1 reply · 2 participants
  • x

    xap4o

    06/25/2017, 1:47 PM
    I'm trying to run kotlin-fullstack-example https://github.com/Kotlin/kotlin-fullstack-sample I clone git repo and run
    gradle :frontend:run
    Then get following error:
    > Task :frontend:npm-install
    npm ERR! code ETARGET
    npm ERR! notarget No matching version found for kotlin@1.1.1
    npm ERR! notarget In most cases you or one of your dependencies are requesting
    npm ERR! notarget a package version that doesn't exist.
    npm ERR! notarget
    Anybody managed to get it running?
    o
    1 reply · 2 participants
  • d

    diesieben07

    06/25/2017, 4:12 PM
    Your function needs a generic parameter
    <T>
    , so
    fun <T> List<T>.moodi ...
    👍 1
    t
    1 reply · 2 participants
  • d

    diesieben07

    06/25/2017, 8:18 PM
    &
    becomes
    and
    ,
    |
    becomes
    or
    and
    <<
    becomes
    shl
    . Bit manipulation is highly suboptimal in Kotlin at the moment, sadly.
    d
    2 replies · 2 participants
  • p

    Paul Woitaschek

    06/25/2017, 8:20 PM
    It does not work @diesieben07
    d
    u
    10 replies · 3 participants
  • a

    alexreidy

    06/25/2017, 9:47 PM
    This has been known for probably at least a year and nobody thinks it's worth addressing? Makes me wonder what else I'm going to run into with Kotlin. Maybe a compiler warning would be a good start: "Calling valid code from here can easily result in null pointer exceptions where they are ordinarily impossible" ... this feels like undefined behavior.
    d
    x
    4 replies · 3 participants
  • l

    leonardootto

    06/26/2017, 2:39 AM
    Hello everyone. Who knows more information about the word Kotlin. I know that is island name, but why the name of island is Kotlin?
    g
    v
    4 replies · 3 participants
  • p

    pavlospt

    06/26/2017, 9:36 AM
    hello, so i was trying to find a more elegant way to write the following:
    selectedChoices.mapIndexed { index, isSelected -> if (isSelected) index else -1 }.filter { it != -1 }
    . Is there a prettier way to write this ? 🙂 In short what I want to do is get the indexes from
    selectedChoices
    , which is a BooleanArray, where the value is
    true
    and then map those indexes in something different, hence the
    .filter { it != -1}
    (also not sure if I am on the right channel)
    m
    p
    3 replies · 3 participants
  • l

    lupajz

    06/26/2017, 9:42 AM
    @pavlospt
    selectedChoices.foldIndexed(mutableListOf<Int>()) { index, acc, bool ->
            if(bool) {
                acc.add(index)
                acc
            }
            else acc
        }
    Can be ?
    👍 2
    m
    p
    4 replies · 3 participants
  • r

    rockerhieu

    06/26/2017, 2:21 PM
    Is there any shorthand for
    if (condition) a else b
    ?
    t
    3 replies · 2 participants
  • t

    treelzebub

    06/26/2017, 6:13 PM
    hi all-- is anyone here using a static analysis tool for security vulnerabilities with Kotlin? currently shopping around… the security team here is against analyzing java bytecode, and they’re not going to budge 😕
    v
    2 replies · 2 participants
  • s

    shirbal

    06/26/2017, 6:50 PM
    How do I write custom setters for a class variables where the class is data class ?
    r
    l
    8 replies · 3 participants
  • m

    mg6maciej

    06/27/2017, 10:10 AM
    @oblakr24 You may check generated bytecode from IDE (and then convert it to Java for easy reading).
    👍 1
    o
    1 reply · 2 participants
  • d

    Dalinar

    06/27/2017, 11:15 AM
    @maciekjanusz to tell you the truth I had no use for it until I started programming in Kotlin JS, there I came across a few situations where it could be useful - usually in an if else type scenario. if "success" call with all parameters, if failure call with null on a parameter... (because you can't really pass anything else to the parameter since the value is not available due to failure. Why useful for me in JS? because in JS I have a lot of callback type situations. My way of thinking is that functions have parameters, but function types also have parameters - so why not? but I imagine it's not required most of the time by most people.
    m
    m
    7 replies · 3 participants
  • i

    ikozlowski

    06/27/2017, 2:33 PM
    hi, anyone here tried to use kotlin with hibernate and jackson? (also spring, but i dont think this is important here) after adding kotlin-noarg and kotlin-jpa to my project I got
    com.fasterxml.jackson.databind.JsonMappingException: Could not find creator property with name zxc
    errors for entities that works without this plugin
    stdlib-jre8, kotlin-reflect, 1.1.2-5
    jackson-core, jackson-datatype-jsr310, jackson-module-kotlin 2.8.9
    hibernate-java8 5.2.10.Final
    a
    f
    +1
    10 replies · 4 participants
  • b

    burak.eregar

    06/27/2017, 5:22 PM
    https://medium.com/@burakeregar/kotlin-in-android-mvp-dependency-injection-dagger2-clean-architecture-13a47869dba4
    n
    3 replies · 2 participants
  • u

    user

    06/27/2017, 5:58 PM
    Early access program for Kotlin 1.2 has been started We’re excited to announce the start of the early access program for Kotlin 1.2: today its first milestone release 1.2-M1 is out. This release enables by default new language features that were previously available in 1.1.x releases under experimental 1.2 … Continue reading →
    d
    1 reply · 1 participant
  • d

    danko9

    06/27/2017, 6:36 PM
    so i'm having trouble with lazy delegated properties in deserialized classes
    k
    1 reply · 2 participants
  • r

    redrield

    06/27/2017, 7:51 PM
    If you're gonna add something, don't go halfway 🙄
    r
    16 replies · 2 participants
  • m

    menegatti

    06/28/2017, 8:14 AM
    What would cause the kotlin bytecode decompiler not work? I got error message
    Failed to decompile X.kt. Method Y couldn't be written
    k
    2 replies · 2 participants
  • r

    rrva

    06/28/2017, 1:22 PM
    If I only want to modify a nested field of a data class, using
    copy()
    , what’s the cleanest way to write it? this obviously does not work:
    val widget = widget.copy(owner = this.copy(firstName = "alfred"))
    d
    1 reply · 2 participants
  • d

    diesieben07

    06/28/2017, 2:01 PM
    No, you cannot. Think of extension functions as syntax sugar for "static methods".
    d
    3 replies · 2 participants
  • c

    christophsturm

    06/28/2017, 3:50 PM
    yes, this is just for my unit tests, where i care only about readability
    c
    1 reply · 2 participants
Powered by Linen
Title
c

christophsturm

06/28/2017, 3:50 PM
yes, this is just for my unit tests, where i care only about readability
c

Czar

06/29/2017, 5:39 AM
christophsturm: Depending on the size of your testing code base you may have to care for the performance at some point 😉
View count: 5