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

    jstuyts-squins

    09/29/2017, 9:19 AM
    It depends on what the goal of your code is. In this case you need to take an alternative path if
    projID
    is not given, show this decision in the code clearly
    g
    • 2
    • 1
  • n

    nerses

    09/29/2017, 10:08 AM
    Can i suggest to have a closed channel that only JB people can write named “announcemets” where this kind of info will be posted. Currently it’s not easy to track what happens if you are away for some time.
    a
    • 2
    • 1
  • s

    sksk

    09/29/2017, 10:17 AM
    http://kotlinlang.org/docs/reference/multiplatform.html gives me 404 error
    👍 1
    r
    • 2
    • 3
  • r

    rwachol

    09/29/2017, 10:28 AM
    there’s no multiplatform then
  • o

    orafaaraujo

    09/29/2017, 1:19 PM
    Hello, everyone I've created a Twitter profile that posts a new tweet whenever a new Kotlin version is released https://twitter.com/kotlin_version
    👍 2
    • 1
    • 1
  • k

    karelpeeters

    09/29/2017, 1:21 PM
    Like this one? https://kotlinlang.slack.com/archives/C0922A726/p1506679391000249
    o
    • 2
    • 5
  • m

    mike_shysh

    09/29/2017, 2:57 PM
    In addition to my question, I see that gradle task ':copyMainKotlinClasses' is missing in 1.1.51
    h
    • 2
    • 2
  • r

    roman.belov

    09/29/2017, 4:17 PM
    @harmony Already fixed. All artefacts are available now and Kotlin 1.2 Beta is finally out. Welcome to give it a try!
    🎉 3
    t
    • 2
    • 1
  • r

    roman.belov

    09/29/2017, 4:19 PM
    📣 📣 📣 📣 This time it’s an official release 😉 really, no kidding 😄 📣 📣 📣 📣
    😂 8
    :kotlin: 12
    e
    k
    • 3
    • 4
  • t

    trevjones

    09/29/2017, 10:51 PM
    data class Foo(val foo: Int) {
        data class Bar(val bar: Int)
    }
    👍 1
    m
    • 2
    • 1
  • j

    jaguililla

    09/30/2017, 11:32 AM
    Make 4 PRs and win a shirt in Digital Ocean's Hacktoberfest (https://goo.gl/heoq39)! There are some Kotlin projects out there... Like Hexagon: https://goo.gl/JDnFav pick a task if you want to help me with the project 🙂
    o
    • 2
    • 2
  • k

    karelpeeters

    09/30/2017, 7:01 PM
    You can if you use reflection, but otherwise no. Instead consider adding a parameter for the constructor:
    inline fun foo<reified T>(constr: () -> T) { ... }
    . You might not even need the
    reified
    anymore.
    e
    • 2
    • 2
  • d

    Dalinar

    10/01/2017, 10:01 AM
    what exactly is copied in a copy() of a data class? just the properties declared in the constructor?
    k
    • 2
    • 1
  • h

    henrik

    10/01/2017, 7:44 PM
    More unnecessary code… 🙂
  • r

    raulraja

    10/01/2017, 11:30 PM
    Is there a
    gradle
    task that will launch in the console the
    kotlinc
    REPL with the project classpath ready?
    k
    • 2
    • 1
  • p

    Paul Woitaschek

    10/02/2017, 7:12 AM
    @qwert_ukg What does that mean?
    q
    • 2
    • 3
  • e

    enleur

    10/02/2017, 7:18 AM
    val (even, odd) = listOf(1.2, 2.0, 4.1, 6.0)
        .partition { it.isEven() }
    q
    r
    b
    • 4
    • 9
  • k

    karelpeeters

    10/02/2017, 9:02 AM
    Aren't you back at square one then?
    t
    • 2
    • 1
  • p

    pokkeli

    10/02/2017, 2:54 PM
    I am using the very latest Intellij IDEA Community EAP, Kotlin 1.2 beta 31, Gradle 4.2, and Java 9. I have a Kotlin JVM project. With Java 9 as a project JDK, running/building the project fails (at least occasionally): I get unresolved references to my own classes, which are defined in the very same project. I believe these classes are 100% Kotlin objects / singletons. I also receive zero unresolved reference errors in the IDE itself, only upon building. The only thing that seems to help, is to rebuild the whole project. Anyone else encountered this same thing? Is there a workaround - other than not using Java 9?
    d
    • 2
    • 1
  • z

    zealous

    10/02/2017, 8:43 PM
    @addingama have a look at https://github.com/edvin/tornadofx/wiki/Type-Safe-Builders#what-if-there-is-no-builder-for-the-control-im-adding
    a
    • 2
    • 1
  • n

    nulldev

    10/02/2017, 9:02 PM
    Is there any way to have a setter for a variable declared in the constructor? I have a data class where I must have a setter for one of the fields. Example:
    data class WTF(var name: String
                                      set(value) {
                                          println("This doesn't work 😞")
                                      }
                               )
    r
    g
    g
    • 4
    • 6
  • o

    Olekss

    10/03/2017, 7:59 AM
    Guys. I can't decypher deep meening behind run extension funciton which has the form of public inline fun <R> run(block: () -> R): R = block() ? What is deep design thinking behind this
    k
    • 2
    • 1
  • g

    geekasm

    10/03/2017, 9:54 AM
    I am developing web-server on top of ktor. want to use a good DI framework along with it. any recommendations ? kodein ?
    g
    • 2
    • 1
  • a

    arekolek

    10/03/2017, 10:06 AM
    I just posted a SAM-constructor related question to stackoverflow somebody might find interesting, or maybe knows how to answer: https://stackoverflow.com/q/46542037/1916449
    b
    • 2
    • 1
  • o

    Olekss

    10/03/2017, 10:38 AM
    @Czar I get the receiver version of run. But what is simple "run" which just executes block?
    c
    a
    • 3
    • 3
  • m

    marstran

    10/03/2017, 10:54 AM
    I guess you could create your own extension function like this:
    fun <T1: Closeable?, T2: Closeable?, R> Pair<T1, T2>.use(block: (T1, T2) -> R): R =
                first.use { a -> second.use { b -> block(a, b) } }
    You could then do
    (Buffer() to Okio.source(file)).use { buffer, source -> ... }
    .
    i
    • 2
    • 1
  • c

    Czar

    10/03/2017, 12:10 PM
    after
    use
    execution both first and second will be closed, so the object becomes unusable. I'm sorry for so many uses of the word 'use', but here I kinda have to 😄
    m
    b
    • 3
    • 6
  • d

    dave08

    10/03/2017, 12:18 PM
    Any easy way to make a class implementing
    operator iterator()
    that returns a custom iterator that implements
    operator hasNext()
    and
    operator next()
    , to return a List? It seems that currently the only way is to make a mutable list and then
    for (e in iterator) list.add(e)
    ...?
    f
    • 2
    • 10
  • d

    dave08

    10/03/2017, 12:48 PM
    @karelpeeters I guess you're right 😢
    k
    • 2
    • 1
  • r

    rocketraman

    10/03/2017, 3:16 PM
    Getting this error when trying to use the synthetic property "password" (i.e.
    password = "something"
    ) in an
    apply
    for
    SQLServerDataSource
    which has a
    setPassword
    method:
    Cannot access 'password': it is public/*package*/ for synthetic extension in '<dependencies of my-module>'
    . Calling
    setPassword
    explicitly works correctly (Kotlin 1.1.51).
    :youtrack: 1
    • 1
    • 1
Powered by Linen
Title
r

rocketraman

10/03/2017, 3:16 PM
Getting this error when trying to use the synthetic property "password" (i.e.
password = "something"
) in an
apply
for
SQLServerDataSource
which has a
setPassword
method:
Cannot access 'password': it is public/*package*/ for synthetic extension in '<dependencies of my-module>'
. Calling
setPassword
explicitly works correctly (Kotlin 1.1.51).
:youtrack: 1
FYI, created: https://youtrack.jetbrains.com/issue/KT-20602
View count: 2