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

    karelpeeters

    11/14/2017, 10:00 PM
    But that doesn't work for variables and for classes it exposes the generic parameter which I don't really want.
    p
    p
    p
    • 4
    • 7
  • s

    sailxjx

    11/15/2017, 7:56 AM
    I mean maybe I will use some libraries in coroutines, but these libraries may contain
    Thread.sleep
    g
    • 2
    • 2
  • m

    Minty

    11/15/2017, 9:08 AM
    https://kotlinlang.slack.com/archives/C3SGXARS6/p1510736890000397
    g
    • 2
    • 1
  • m

    Minty

    11/15/2017, 9:09 AM
    https://github.com/JetBrains/kotlin-native/issues/587
    c
    • 2
    • 1
  • n

    noncom

    11/15/2017, 3:23 PM
    as far, as I understand, in general, some Kotlin code would be untransferable to a different compiler backend, if it uses any Java library or anything JVM-specific, right?
    d
    • 2
    • 1
  • d

    david.bilik

    11/16/2017, 7:59 AM
    Hi, is it some known issue or problem of mine that if you have too many nested lambdas, proguard fails? My code is something like this
    with(layout) {
        viewmodel.observeData()
            .subscribe {
                myField.setDataWithCallback(it, {
                    viewmodel.onFieldChanged(it)
                })
        }
    }
    and proguard fails on
    Warning: com.example.calculator.CalculatorFragment$onViewCreated$1$4$1: can't find referenced class com.example.calculator.CalculatorFragment$onViewCreated$1$4
    It happened to me before and i solved that by refactoring my code to multiple methods but still, I dont think its necessary here
    o
    • 2
    • 4
  • s

    Scott

    11/16/2017, 11:50 AM
    New Kotlin Discord channel with many voice and text sub-rooms for people to use for collaboration, help with problems or whatever else. *There is a separate channel for advertising books and courses so don't spam other rooms or those posts will be deleted. We hope to see you there! https://discord.gg/8AAfda3
    👍 1
    e
    r
    • 3
    • 6
  • n

    nerses

    11/16/2017, 1:07 PM
    Nullable reference types in C# https://blogs.msdn.microsoft.com/dotnet/2017/11/15/nullable-reference-types-in-csharp/ Shame they don’t mention Kotlin in the article
    k
    a
    • 3
    • 2
  • m

    matej

    11/16/2017, 1:15 PM
    That moment when you're going back and forth between Kotlin and Java code and spend 10 seconds staring at it wondering why the IDE is complaining that it
    Cannot resolve symbol 'val'
    , only to realize you're in a Java class.
    😬 9
    c
    • 2
    • 3
  • m

    mingkangpan

    11/16/2017, 1:58 PM
    https://twitter.com/newsycbot/status/930617989585661952
    h
    t
    b
    • 4
    • 3
  • l

    Loránd

    11/16/2017, 4:36 PM
    Hello i am trying to get kotlin koans to work but i keep getting this error all the time after importing the gradle project
    Error:Could not initialize class org.jetbrains.kotlin.gradle.KotlinGradleModelBuilder
    does anyone have a sugesstion on how to solve this?
    a
    • 2
    • 4
  • k

    kantsu

    11/16/2017, 10:00 PM
    I read on SO and converted to this
    while (`in`!!.readLine() != null) {
                    line = `in`!!.readLine()
                    outputText += line
                }
    g
    c
    • 3
    • 4
  • h

    hho

    11/17/2017, 12:54 PM
    The former extends the latter with support for Java 7 specific stuff (e.g.
    AutoCloseable
    ).
    m
    • 2
    • 1
  • p

    pokkeli

    11/17/2017, 1:28 PM
    I have a Gradle (Kotlin) project & latest IDEA EAP. How can I easily switch from Groovy build.gradle to Kotlin build.gradle? Can I simply accomplish this with "New Gradle Kotlin DSL Build Script" and will it automatically become default for the project? Also, should I type extension for the filename? I'm a bit hesitant trying, because I tried around a month-two ago, and I recall screwing up something with this...
    c
    • 2
    • 2
  • d

    dave

    11/17/2017, 6:48 PM
    Is there a problem with the signup for this slack? Had a report that someone is trying to sign up, but it requires a jetbrains.com email address...
    p
    • 2
    • 3
  • j

    jdiaz

    11/18/2017, 5:03 PM
    If I define in Kotlin List<Int> in java is expecting List<? extends Integer>, what's the way of maintaining compatibility?
    s
    a
    d
    • 4
    • 5
  • l

    lclc

    11/18/2017, 5:06 PM
    What's the best library for Websockets (client side, using JVM) ?
    t
    d
    • 3
    • 2
  • e

    evanchooly

    11/18/2017, 5:52 PM
    tyrus is the RI at the least
    d
    • 2
    • 2
  • c

    Czar

    11/19/2017, 6:45 PM
    @ziad using
    String#hashCode
    for this is a really bad idea
    z
    • 2
    • 5
  • h

    haining

    11/20/2017, 2:40 AM
    I'm looking to identify the term for something, what do you call it in kotlin when you invoke a method through the class while passing the
    this
    argument explicitly as in
    (String::take)("hello", 3)
    or even, what you call the
    String::take
    part?
    f
    c
    • 3
    • 4
  • e

    eygraber

    11/20/2017, 5:09 AM
    If I have a function that takes a SAM with one argument as a parameter, and I have a function with one argument that I want to pass to it, I can use a function reference. But if that function takes 2 arguments, and the second has a default value, I can't. Are there any plans to address that in the future?
    g
    • 2
    • 1
  • p

    pappu

    11/20/2017, 5:45 AM
    I dont know java but trying to make a simple app using kotlin....😁 please experienced people ........ How to display a local HTML file in webview with kotlin ........ Thank u
    g
    • 2
    • 1
  • e

    edwardwongtl

    11/20/2017, 7:27 AM
    It there a convenient way to split a list of items into many smaller list of n items? e.g. a list of 100 items into 5 list of 20 items
    g
    • 2
    • 4
  • o

    oleksiyp

    11/21/2017, 7:03 AM
    I need to proofread English documentation. Anybody wishing to contribute?
    s
    • 2
    • 4
  • e

    ecampolo

    11/21/2017, 10:54 AM
    I wonder how I can validate an entity in its properties both via constructor and setter without duplicating code. More formally, how do you get around with aggregate invariants (DDD). For example:
    class Person(email: String) {
        var email: String = email
        set(value) {
            require(value.trim().isNotEmpty(), { "The email cannot be blank" })
            field = value
        }
    
        init {
            require(email.trim().isNotEmpty(), { "The email cannot be blank" })
        }
    }
    I tried with Delegation but feels a little bit complex since I would need to have NotEmptyString , NotEmptyCollection, or any kind of validation. Also I want to avoid those extra objects per property.
    a
    • 2
    • 14
  • x

    Xatenev

    11/21/2017, 2:20 PM
    I have a question regarding the used regex engine in WebStorm/ PHPStorm
    c
    k
    • 3
    • 6
  • a

    Andrew

    11/21/2017, 4:59 PM
    Hello, I'm newbie in Kotlin and have one question. Can I crosscompile from Linux to Windows?
    o
    • 2
    • 1
  • s

    sxtanna

    11/21/2017, 10:19 PM
    These being the two methods?
    o
    • 2
    • 3
  • a

    alexcouch

    11/21/2017, 10:58 PM
    Can KCallable be interchanged with Callable? I need to pass in a method reference to a Java method that uses Callable as a parameter but it seems as though that the kotlin function references aren't the same as Java, and they only work with KCallable. I tried to cast KCallable to Callable but I ended up getting a casting exception saying that they can't be casted properly. Is there some way to do this safely? Or is there a way to pass in a java method reference in kotlin?
    a
    • 2
    • 6
  • g

    groostav

    11/22/2017, 6:43 AM
    thoughts?
    f
    • 2
    • 1
Powered by Linen
Title
g

groostav

11/22/2017, 6:43 AM
thoughts?
f

Fré Dumazy

11/22/2017, 8:44 AM
Do you have an example of how it can be used? 🙂
View count: 5