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

    kirillrakhman

    05/19/2017, 9:39 AM
    I heard the "Kotlin in Action" one was pretty dope.
    t
    2 replies · 2 participants
  • k

    kirillrakhman

    05/19/2017, 9:42 AM
    #random? 😄
    d
    b
    2 replies · 3 participants
  • m

    madusudanan

    05/19/2017, 10:03 AM
    Pretty much summed up here - https://medium.freecodecamp.com/so-yeah-we-tried-slack-and-we-deeply-regretted-it-391bcc714c81
    ❤️ 1
    s
    3 replies · 2 participants
  • m

    madusudanan

    05/19/2017, 10:07 AM
    but whoah...from 1K users to 7.6K
    t
    2 replies · 2 participants
  • m

    maciekjanusz

    05/19/2017, 10:15 AM
    lateinit var a: String
    makes it possible to have non-nullable type and yet allow for this edge case of it being null until properly assigned value AFTER construction
    l
    4 replies · 2 participants
  • d

    David W

    05/19/2017, 10:26 AM
    I like
    apply
    for when you are modifying properties of a class as you initialize it, eg:
    val obj = ObjWithoutConstructor().apply {
        somePropOfObj = "value1"
    }
    👍 1
    m
    5 replies · 2 participants
  • b

    bamdmux

    05/19/2017, 10:38 AM
    And if newcomers need tips, theres the idioms page https://kotlinlang.org/docs/reference/idioms.html
    😮 1
    d
    4 replies · 2 participants
  • m

    myanmarking

    05/19/2017, 2:36 PM
    does anybody know what time is kotlin presentation today?
    l
    3 replies · 2 participants
  • o

    omarkj

    05/19/2017, 3:22 PM
    Does Kotlin’s pattern matching use
    equals
    ? Wondering if it that’s the reason matching on Pair elements isn’t possible.
    k
    2 replies · 2 participants
  • e

    elizarov

    05/19/2017, 4:21 PM
    @voddan it is in the faq. It will continue to be sponsored by JB.
    v
    1 reply · 2 participants
  • e

    eric239

    05/19/2017, 4:43 PM
    Is there a “kotlin way” to handle delegation to a class (as opposed to an interface). E.g. I have a class
    Base
    which doesn’t implement anything, and I want to create class
    Derived
    which extends
    Base
    and delegates to an instance of
    Base
    . I know I can use regular java dynamic proxies; wondering if there’s a “kotlin” way.
    d
    2 replies · 2 participants
  • c

    cedric

    05/19/2017, 4:50 PM
    @elizarov Erlang’s dynamic typing is only one of its many shortcomings. I’ll add strings (disaster), the supervisor model which still requires you to do so much manual hook up (a topic carefully avoided by Erlang advocates), the claim to “let it crash” as if it’s unique to Erlang, the terrible error messages and associated tooling, etc…
    e
    3 replies · 2 participants
  • v

    vaskir

    05/19/2017, 5:35 PM
    I'm struggling to find real world Kotlin lambdas on github. Any links?
    o
    2 replies · 2 participants
  • i

    ivykp

    05/19/2017, 9:33 PM
    Hello everybody, i am reading Kotlin in Action, a beautiful book and i have a little question: Currently i am working with Scala and i was wondering if there is something like import java.util.{func1, func2} in Kotlin?
    r
    t
    3 replies · 3 participants
  • a

    andyg

    05/20/2017, 1:21 AM
    Hi Slackers, lease help... can't figure this one and can't find it via Google. Should be simple...
    "The %s %s fox jumped over the %s dog".format(<http://Locale.US|Locale.US>, adjectives)
    adjectives
    is a
    MutableList<String>
    with 3 entries I keep getting
    MissingFormatArgumentException
    . Have tried casting to
    TypedArray
    ,
    Array<Any>
    , and more. Thank you!
    g
    3 replies · 2 participants
  • r

    redrield

    05/20/2017, 1:23 AM
    Can someone point me to where in the documentation <reified T> is described?
    i
    1 reply · 2 participants
  • p

    pakoito

    05/20/2017, 1:41 AM
    fun <G : Applicative<*>, A, B> traverse(fa: HK<F, A>): (f: (A) -> HK<G, B>) -> HK<G, HK<F, B>>
    is this valid syntax? that f name looks out of place, yet it compiles
    k
    4 replies · 2 participants
  • d

    Dibya

    05/20/2017, 2:43 AM
    good book /tutorial to learn kotlin??
    i
    u
    2 replies · 3 participants
  • v

    voddan

    05/20/2017, 7:41 AM
    :kotlin-flag: I know this is totally pointless, but would you consider adding a ⭐ to the Kotlin repo https://github.com/JetBrains/kotlin ? In a Github programming language rating Kotlin ranks 8th https://github.com/showcases/programming-languages?s=stars All I hope for is overtaking PHP 🐘 (less than 1000 ⭐ away)
    :kotlin: 3
    ⭐ 13
    🐘 1
    ♦️ 1
    l
    d
    +1
    6 replies · 4 participants
  • r

    ravikumar

    05/20/2017, 11:34 AM
    Copy & pasting a kotlin code in IntelliJ(2017.2EAP) creates a java file instead of kotlin file. Am I missing something or that support is not yet added?
    v
    y
    4 replies · 3 participants
  • d

    Dalinar

    05/20/2017, 12:32 PM
    what is wrong with this code? why does it return a negative value (if I use a lower number like
    20
    it seems to work, but a number like
    100
    will also cause a large negative value )
    println(fibonacci(50).last())
    fun fibonacci() = generateSequence(Pair(0, 1), { Pair(it.second, it.first + it.second) }).map { it.first }
    fun fibonacci(n: Int): Sequence<Int> = fibonacci().take(n)
    m
    1 reply · 2 participants
  • a

    antoin_m

    05/20/2017, 1:05 PM
    Hey guys. Noob here. I was trying to do something with kotlin and spring but when I try to run the code in intellij I get :
    Error:Kotlin: Unsupported plugin option: org.jetbrains.kotlin.allopen:preset=spring
    Everything is fine when I build to a jar though. Any idea? 😕
    1 reply · 1 participant
  • a

    argoneus

    05/20/2017, 5:12 PM
    I thought lambdas were always inline
    j
    2 replies · 2 participants
  • v

    vaskir

    05/20/2017, 8:08 PM
    Jan Vladimir Mostert: https://en.wikipedia.org/wiki/Covariance_and_contravariance_(computer_science)
    j
    1 reply · 2 participants
  • m

    mg6maciej

    05/21/2017, 9:49 AM
    I'll put that in :youtrack: then.
    1 reply · 1 participant
  • a

    argoneus

    05/21/2017, 10:03 AM
    val srl_view = view?.findViewById(R.id.refresh_servers) ?: return
    val srl = srl_view as SwipeRefreshLayout
    m
    2 replies · 2 participants
  • b

    bod

    05/21/2017, 1:37 PM
    So… I’m not sure what the current status is - are we currently supposed to use
    apply plugin: 'kotlin-kapt'
    or is it an experimental thing? I mean you can use
    kapt
    dependencies even if you don’t do it, but it works differently it seems - which is a bit confusing. Any clarification on this would be much appreciated 🙂
    i
    l
    18 replies · 3 participants
  • d

    deviant

    05/21/2017, 2:02 PM
    guys, is there known bug with
    provideDelegate
    operator? It's just not being called when i'm trying to instantiate delegate via helper function, such
    fun <T> observableField(default: T? = null): ReadWriteProperty<Observable, T?> = ObservableFieldProperty(default)
    the operator works ok though when i instantiate delegated property directly with class constructor
    ❓ 1
    :youtrack: 1
    i
    2 replies · 2 participants
  • m

    mipster

    05/21/2017, 4:38 PM
    hey, so i just came here is it ok to ask questions about kotlin code here or should i go to to getting started?
    j
    1 reply · 2 participants
  • r

    redrield

    05/21/2017, 5:05 PM
    Why is it that recursive calls to get() on a field aren't highlighted by the Kotlin plugin?
    m
    2 replies · 2 participants
Powered by Linen
Title
r

redrield

05/21/2017, 5:05 PM
Why is it that recursive calls to get() on a field aren't highlighted by the Kotlin plugin?
m

mg6maciej

05/21/2017, 5:10 PM
redrield: The answer is: 1. No software is perfect before infinity. 2. You haven't :youtrack: kotl.in/issue yet.
r

redrield

05/21/2017, 5:16 PM
https://youtrack.jetbrains.com/issue/KT-17998
👍 3
View count: 2