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

    Fudge

    06/05/2019, 10:42 AM
    Is there a Kotlin performance profiler for Windows?
    g
    s
    m
    • 4
    • 10
  • g

    ghosalmartin

    06/05/2019, 12:37 PM
    is setter for a field called for the initial value?
    🇳🇴 1
    k
    k
    • 3
    • 2
  • t

    tseisel

    06/05/2019, 2:54 PM
    I've heard a lot about KEEP87 recently. After reading that article : https://quickbirdstudios.com/blog/keep-87-typeclasses-kotlin/ I have now a basic understanding the feature request, but still have trouble finding how I could use it in my projects. Does anyone have sample use cases, apart from the
    equals
    problem described in the article and functionnal programming (that I don't really understand at the moment 😅) ?
    a
    i
    k
    • 4
    • 4
  • x

    xenoterracide

    06/05/2019, 4:51 PM
    I didn’t think ?.let returned a value?
    r
    r
    • 3
    • 3
  • j

    jaguililla

    06/05/2019, 5:30 PM
    Hello everyone, Hexagon 1.0 got released!!! It is a toolkit for developing web services in Kotlin heavily inspired in Javalin and Spark. I would like to gather feedback from the community, so if you could take a look at it, share your thoughts, spread the word among other Kotlin developers and/or give it a star 😉 It would be much appreciated 🙂 https://hexagonkt.com https://github.com/hexagonkt
    r
    • 2
    • 2
  • k

    Kotlin-Jobs.com

    06/05/2019, 8:12 PM
    Does anyone have a favorite tutorial on getting up and running with Kotlin, preferably with examples that even publish at least one app? I'm compiling a list and so far have found the following: https://www.udacity.com/course/developing-android-apps-with-kotlin--ud9012 https://www.udacity.com/course/kotlin-for-android-developers--ud888 https://www.udacity.com/course/kotlin-bootcamp-for-programmers--ud9011 https://www.udemy.com/kotlin-course/ https://www.udemy.com/the-complete-kotlin-developer-course/ https://www.udemy.com/android-app-development-using-kotlin/
    n
    s
    • 3
    • 4
  • n

    napperley

    06/05/2019, 11:24 PM
    What is the current state of JMOD support in Kotlin? Have encountered a roadblock in a project where JavaFX 8 is used that would likely be resolved by using JavaFX 9 and above, however JavaFX starting from version 9 uses JMOD, which Kotlin doesn't support.
    s
    • 2
    • 1
  • s

    Stefan Beyer

    06/06/2019, 11:52 AM
    Does anyone know how to auto import an overloaded array access operator in intellij? Example:
    // java
    package com.example.legacy
    public class Thing {
        public String get(String s) {
            return s;
        }
    }
    // kotlin
    package com.example.extensions
    import com.example.legacy.Thing
    operator fun Thing.get(index: Int) = index
    // kotlin
    package com.example.business.logic
    import com.example.legacy.Thing
    fun doStuff(thing: Thing) {
        val x = thing[1] // compiler says "String expected, but Int found"
    }
    At
    val x = thing[1]
    there is a compile error, because the extension in
    com.example.extensions
    is not yet imported. But I cannot conveniently import it... When I instead write it as a method call (
    val x = thing.get(1)
    ) it tells me that it can import it and I can just hit Alt+Enter and the import is added. Then I can change it back to the array access syntax. is there a shorter and more convenient way to get this import line added?
    k
    • 2
    • 2
  • p

    Paul Woitaschek

    06/06/2019, 12:56 PM
    kotlin
    interface Greeter {
      fun greet()
    }
    
    class HappyGreeter : Greeter {
      override fun greet() {
        println("hello :)")
      }
    }
    
    class SadGreeter : Greeter {
      override fun greet() {
        println("hello :(")
      }
    }
    
    class GreeterDelegate (val greeters : List<Greeter>): Greeter by greeters
    d
    m
    +2
    • 5
    • 6
  • p

    pp.amorim

    06/06/2019, 3:28 PM
    https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.jvm.functions/-function-n/invoke.html -> returning 404
    k
    l
    a
    • 4
    • 4
  • m

    mzgreen

    06/06/2019, 8:05 PM
    What is the best place to start/ask if I would like to start contributing to kotlin? Are there any starter tasks or something besides the documentation?
    k
    • 2
    • 2
  • j

    jkbbwr

    06/07/2019, 9:16 AM
    anyone know why clion is booting overscaled on a 4k display on linux?
    a
    a
    • 3
    • 3
  • n

    necati

    06/07/2019, 1:12 PM
    😒uspend: Does anyone have this icon? 🙂
    d
    • 2
    • 2
  • e

    Eric Martori

    06/07/2019, 2:40 PM
    is there a reason why am I getting:
    '@JvmName': is not applicable to this declaration
    for an extension function in an interface?
    i
    • 2
    • 2
  • k

    Krotick

    06/07/2019, 3:22 PM
    @Shawn Thanks! I meant, I already specify Java version (or so it seems) in` java` block, how can I not define it in
    tasks
    ?
    g
    • 2
    • 8
  • a

    Alexjok

    06/07/2019, 3:36 PM
    Hello, it is possible do parallel filter via collection stream?
    g
    k
    • 3
    • 12
  • p

    projectmoon

    06/07/2019, 4:04 PM
    what is a kotliny way to generate a list of elements given a number of elements? e.g. something like
    5.times |x| mylist << x
    in ruby
    p
    n
    +2
    • 5
    • 7
  • j

    janvladimirmostert

    06/08/2019, 11:33 AM
    what would be the right place to post about kotlinx.html (JVM version) ?
    d
    • 2
    • 23
  • z

    Zemeio

    06/08/2019, 6:15 PM
    Hi guys. Is there a simple way to do cyclic data classes? If I do it normaly most of the methods will break.
    s
    e
    l
    • 4
    • 8
  • s

    Saiedmomen

    06/09/2019, 7:55 AM
    In @hhariri's io19 talk ineqality shows up as ≠. How can I do it? Is it an IDE feature?
    h
    • 2
    • 2
  • p

    Pietro Poluzzi

    06/09/2019, 1:05 PM
    Good morning everyone, I'm studying TornadoFX framework and I'd like to know how to add an icon to the GUI. (I have no experience whit JavaFX).
    r
    • 2
    • 2
  • a

    Andrew Gazelka

    06/09/2019, 3:35 PM
    let's say I have a config which has several values with several variables
    a,b,c,...,z
    Let's say I have a complicated algorithm/function sequence which I want to break up into smaller unit testable functions. Each function takes a subset of config values and some calculated values (by previous parts by other functions)... this can get pretty annoying as each time I pass arguments into a function I have to pass in a ton. It would be nice if Java/Kotlin supported something like in TS where I can have an interface for some JSON and any JSON which had the proper fields and types would be allowed... this would allow for just passing in the entire config as an argument (or if I am unit testing passing in a subset of the config if needed). I am almost certain there is not a good solution to this in Kotlin/Java, but do you think there is one? I guess you could pass in a map as a parameter but this would not be compile-time type safe ... additionally, nested functions in Kotlin could be nice but the issue with them is that they are impossible to unit test. Thoughts?
    s
    • 2
    • 4
  • h

    Hexa

    06/09/2019, 4:04 PM
    then I get this error
    src/main/kotlin/samples/HelloWorld.kt:7:18: error: unresolved reference: Person
        val person = Person("me")
    p
    • 2
    • 1
  • r

    Rohan Maity

    06/09/2019, 6:27 PM
    @gildor could I DM you ?
    ❓ 1
    g
    • 2
    • 1
  • k

    Kirill Zhukov

    06/10/2019, 3:37 AM
    Is there a way to make smart casting work with sealed classes without having to exhaustively handle every case? For instance I expected this to work since I only have two implementations defined for my sealed class.
    -.kt
    d
    • 2
    • 13
  • h

    Hexa

    06/10/2019, 8:53 AM
    is there a hard and fast rule of when to use
    sequence
    vs when to use
    streams
    ? i know sequence is for processing large collection of data, but is there any reason why can't I use it to process small amount of data?
    g
    k
    • 3
    • 19
  • m

    Mohamed Ibrahim

    06/10/2019, 9:29 AM
    Is this syntax is correct,
    model?.let{ some code} ?: run { code in case model is null}
    g
    t
    +4
    • 7
    • 13
  • j

    Jacques Smuts

    06/10/2019, 10:34 AM
    Using the
    !!
    operator seems to be a frequent source of issues. Has anyone here ever considered turning
    !!
    into a compiler-error lint rule?
    👍 4
    s
    l
    +3
    • 6
    • 9
  • x

    xenoterracide

    06/10/2019, 4:14 PM
    what? it won’t let me get the class of a generically typed instance? I tried !! in several locations,didn’t seem to fix, suggestions?
    w
    l
    r
    • 4
    • 3
  • j

    jlleitschuh

    06/10/2019, 4:37 PM
    Public Disclosure of a fixed JetBrains/Kotlin security vulnerability This writeup is the result of ~ 4 months of research into the software security of the JVM ecosystem's supply chain impacting Gradle, Maven, and SBT users. What I found was quite disturbing. A huge swath of the JVM ecosystem and many of the most popular libraries were all downloading their dependencies over HTTP instead of HTTPS. This also impacted many JetBrains projects including several IntelliJ plugins and the Kotlin Compiler. _Action steps for readers_: Please go check your builds and fix them if they are using
    http
    instead of
    https
    ! I want to thank @Yaroslav Russkih and the entire JetBrains/Kotlin team for being awesome to work with on this security vulnerability. They jumped on it very quickly and began patching all of their repositories swiftly. I believe we've gotten all of them, but if you spot something contact security@jetbrains.com https://medium.com/@jonathan.leitschuh/want-to-take-over-the-java-ecosystem-all-you-need-is-a-mitm-1fc329d898fb?source=friends_link&amp;sk=3c99970c55a899ad9ef41f126efcde0e
    👏🏻 7
    👏🏽 1
    • 1
    • 1
Powered by Linen
Title
j

jlleitschuh

06/10/2019, 4:37 PM
Public Disclosure of a fixed JetBrains/Kotlin security vulnerability This writeup is the result of ~ 4 months of research into the software security of the JVM ecosystem's supply chain impacting Gradle, Maven, and SBT users. What I found was quite disturbing. A huge swath of the JVM ecosystem and many of the most popular libraries were all downloading their dependencies over HTTP instead of HTTPS. This also impacted many JetBrains projects including several IntelliJ plugins and the Kotlin Compiler. _Action steps for readers_: Please go check your builds and fix them if they are using
http
instead of
https
! I want to thank @Yaroslav Russkih and the entire JetBrains/Kotlin team for being awesome to work with on this security vulnerability. They jumped on it very quickly and began patching all of their repositories swiftly. I believe we've gotten all of them, but if you spot something contact security@jetbrains.com https://medium.com/@jonathan.leitschuh/want-to-take-over-the-java-ecosystem-all-you-need-is-a-mitm-1fc329d898fb?source=friends_link&amp;sk=3c99970c55a899ad9ef41f126efcde0e
👏🏻 7
👏🏽 1
The Spring team has also published their own blog post about this as well. https://spring.io/blog/2019/06/10/announcing-nohttp
View count: 5