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

    user

    03/23/2017, 1:56 PM
    message has been deleted
    😀 1
    v
    • 1
    • 1
  • o

    orangy

    03/23/2017, 3:57 PM
    📣 time to join presentation stream at http://jb.gg/kotlinevent1_1 !
    d
    • 2
    • 2
  • n

    nimtiazm

    03/23/2017, 4:32 PM
    make an organized group out of all unorganized viewers 😛
    r
    d
    e
    • 4
    • 6
  • k

    krotki

    03/23/2017, 5:55 PM
    Where can I find full list of features voted for 1.2 ?
    👀 1
    a
    • 2
    • 2
  • z

    zak.taccardi

    03/23/2017, 8:06 PM
    how can I get type safety on a
    sealed class
    when
    statement, when used within an rx stream? ex:
    private val handleDealOperation: (DealOperation) -> State.Change = {
                operation ->
                when (operation) {
                    //how to enforce type safety? `DealOperation` is a sealed class
                }
            }
    Trying to be typesafe in the context of an rx stream.
    source.map(handleDealOperation)
    p
    • 2
    • 3
  • j

    jw

    03/24/2017, 7:02 AM
    I feel like I've done that with a ZipInputStream... But mobile and drunk at the moment...
    📵 2
    🍺 10
    r
    b
    • 3
    • 3
  • b

    beholder

    03/24/2017, 10:52 AM
    https://github.com/JetBrains/kotlin/graphs/contributors - total is 144
    m
    • 2
    • 1
  • c

    cy

    03/24/2017, 2:14 PM
    use Erlang for that 😉
    o
    • 2
    • 1
  • m

    miha-x64

    03/24/2017, 5:00 PM
    operator fun <T> T.plus(collection: Collection<T>): List<T> {
        val result = ArrayList<T>(collection.size + 1)
        result.add(this)
        result.addAll(collection)
        return result
    }
    e
    • 2
    • 2
  • s

    semoro

    03/24/2017, 6:51 PM
    @marcoferrer You can use something like that:
    operator fun <T> FieldDelegate.getValue(thisRef: Any?, property: KProperty<*>): T {
        @Suppress("UNCHECKED_CAST")
        return when(property.returnType) {
            String::class -> ""
            Int::class -> 42
            else -> null
        } as T
    }
    Also please start class names with uppercase 😊
    👍 1
    m
    • 2
    • 1
  • c

    Chris Miller

    03/24/2017, 8:41 PM
    Really interesting and informative talk/Q&A yesterday, thank you @abreslav. I'm curious to learn a little more about the serialisation plans for moving Kotlin objects between processes, eg JVM and Javascript. Will it be possible to hook in to the de)serialisation for use from other languages? I'm hoping it's an efficient binary format. Is there any chance it will be a "zero copy" implementation along the lines of Cap'n Proto, SBE or FlatBuffers, rather than say ProtoBuf or Thrift?
    b
    • 2
    • 2
  • j

    johnl

    03/25/2017, 7:23 AM
    in Kotlin what would be the preferred approach to this
    a
    • 2
    • 1
  • d

    deviant

    03/25/2017, 11:49 AM
    actually i would use
    notNull()
    delegate for just marking property as non null instead of lateinit.
    lateinit
    is rather a hack that exposes public field for easier dependency injection via frameworks such as Dagger, Spring etc.
    p
    • 2
    • 2
  • d

    darkmoon_uk

    03/26/2017, 7:23 AM
    The Kotlin style guide does not appear to mandate K&R brace style; can anyone confirm?
    m
    • 2
    • 1
  • n

    nimtiazm

    03/26/2017, 9:09 AM
    Because some people may prefer bsd/allman brace style
    d
    • 2
    • 3
  • s

    sreich

    03/26/2017, 5:07 PM
    s?.exit?.let { it() }
    says "the expression can't be a selector (occurs after the dot)" edit: nvm that one works, IDEA just wasn't refreshing it as a not-error
    p
    • 2
    • 1
  • y

    yawkat

    03/26/2017, 7:56 PM
    oh god what have I done https://javap.yawk.at/#6e9ewp/procyon
    m
    • 2
    • 1
  • e

    evanchooly

    03/27/2017, 12:49 AM
    here's my new project: https://github.com/evanchooly/kibble
    s
    • 2
    • 19
  • n

    neverwintermoon

    03/27/2017, 9:52 AM
    Hello, I am in a bit of a tight spot trying to write a unit test. Is it possible to mock (with Mockito) a Kotlin extension function? I have extension functions for Uri, Uri itself is mocked, but mocking any of its functions seems to be calling an actual implementation....
    k
    • 2
    • 2
  • m

    mikehearn

    03/27/2017, 1:27 PM
    i was playing with kotlin-argparse yesterday. it's ok. there's always joptsimple.
    s
    • 2
    • 1
  • x

    xenomachina

    03/27/2017, 6:04 PM
    It seems like every time I try to use it, it's grayed out. It would be extremely useful for porting code from an old API to a new one.
    i
    • 2
    • 3
  • d

    dylan.graham

    03/28/2017, 3:15 AM
    Kotlin in Action is half price https://www.manning.com/dotd
    e
    r
    • 3
    • 2
  • i

    ilya.gorbunov

    03/28/2017, 8:20 AM
    @pavlospt pre-release builds are usually announced in #eap channel
    p
    • 2
    • 1
  • s

    sreich

    03/28/2017, 10:00 AM
    Yeah ducks are the worst
    👍 2
    v
    m
    +2
    • 5
    • 21
  • l

    louiscad

    03/28/2017, 12:21 PM
    Anyone knows how
    hashCode()
    is implemented by the Kotlin compiler in a
    data class
    having a `fun`ction property constructor parameter? e.g.:
    data class Option(val id: Int, val desc: () -> String)
    m
    k
    • 3
    • 7
  • a

    andre.figas

    03/30/2017, 11:52 AM
    Good morning. I am beginner on Kotlin. When i use Kotlin on Android Development, i need wrinting my code oriented to object ou function?
    v
    • 2
    • 3
  • o

    orangy

    03/30/2017, 12:24 PM
    Adoption is also climbing up, but right now it is a bit limited with performance issues, IJ is really huge code base and there are some issues with Kotlin plugin making it a bit slower than comfortable. Working on this very actively right now.
    👍 8
    e
    • 2
    • 1
  • k

    kirillrakhman

    03/30/2017, 1:45 PM
    @mikehearn are you aware of IntelliJ's relatively new option to delegate all build actions to Gradle?
  • m

    mzgreen

    03/31/2017, 8:01 AM
    Kotlin allows to create a package named
    case
    but it seems that java does not (or it allows to create a package but it can’t compile files in there because
    case
    is a keyword). So when I created a
    case
    package in Kotlin and then tried to compile the project I got the error saying that `expected indentifier in line 1`(package name) in stub class. I guess this is a bug?
    m
    • 2
    • 6
  • b

    bitkid

    03/31/2017, 9:17 AM
    does anyone know how to tune idea when working with kotlin? its so painfully slow for our small sized project (around 200 source files). everytime i push "run tests" it takes at least 10 seconds where idea writes "searching for compilable file" and then another 10 seconds where it writes "configuring the compilation environment". it drives me crazy (i have a quadcore machine with ssd and 16g ram)
    s
    k
    • 3
    • 9
Powered by Linen
Title
b

bitkid

03/31/2017, 9:17 AM
does anyone know how to tune idea when working with kotlin? its so painfully slow for our small sized project (around 200 source files). everytime i push "run tests" it takes at least 10 seconds where idea writes "searching for compilable file" and then another 10 seconds where it writes "configuring the compilation environment". it drives me crazy (i have a quadcore machine with ssd and 16g ram)
s

semoro

03/31/2017, 9:58 AM
Check
-Xmx
of IDEA
There is setting in Appearance -> Show memory indicator. Check the checkbox and it will appear at bottom right corner of IDEA window
b

bitkid

03/31/2017, 10:06 AM
ok .. i changed it in idea.vmoptions to xms2g and xmx2g
but somehow this didnt help
it still writes 725M
i am on OSX
ah .. changed it in the wrong file
k

kingsley

03/31/2017, 10:11 AM
idea64.vmoptions
?
b

bitkid

03/31/2017, 11:00 AM
~/Library/Preferences/IntelliJIdea2017.1
View count: 1