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

    seba

    02/07/2018, 5:27 AM
    hi all, looking for a sr. android dev with Kotlin experience and familiar with camera api. Need help with a project for a client. If interested please DM me, thanks!
    a
    2 replies · 2 participants
  • m

    marcinmoskala

    02/07/2018, 6:54 AM
    fun a() = 1
    
    class A() {
        fun a() = 2
    
        fun printA() {
            println((::a)())
        }
    }
    
    fun main(args: Array<String>) {
        A().printA() // Prints: 2
    }
    Is there a way I can reference top-level function instead?
    :stackoverflow: 1
    h
    k
    +3
    10 replies · 6 participants
  • n

    noncom

    02/07/2018, 9:25 AM
    Hi! I am having a problem with chosing an extension function in a
    when
    block. The type does not get inferred... here is a little reproducible gist: https://gist.github.com/noncom/ea3e57e676a799efe2943a34b06f2986
    a
    8 replies · 2 participants
  • f

    fitermay

    02/07/2018, 1:24 PM
    I noticed a commit in Kotlin repo for inline class feature. Seems interesting. Is there a spec for it?
    o
    1 reply · 2 participants
  • j

    jkbbwr

    02/07/2018, 1:38 PM
    How does one run kts at runtime
    c
    1 reply · 2 participants
  • r

    rrader

    02/07/2018, 3:45 PM
    https://blog.frankel.ch/comparing-lombok-and-kotlin/
    👏 1
    h
    n
    2 replies · 3 participants
  • j

    jkbbwr

    02/07/2018, 4:25 PM
    Anyone got any idea how to get kotlin JSR registered?
    c
    3 replies · 2 participants
  • b

    beatbrot

    02/07/2018, 5:33 PM
    Hey 🙂 does anyone know a cool kotlin JSON parser? (read only)
    c
    s
    3 replies · 3 participants
  • s

    Shawn

    02/07/2018, 5:44 PM
    you can’t use a typealias to set a conflicting projection variance, though
    r
    1 reply · 2 participants
  • e

    evkaky

    02/07/2018, 5:55 PM
    Hi guys. Can I obtain default value for generic type T? I need something similar to
    T variable = default(T)
    in the C# My first try in kotlin:
    data class Node<K>(val key: K)
    
    class Container<K> {
       var head = Node<K>() // err here, I have to specify *key* prop in the node ctor, but how?
    }
    What can I use?
    a
    3 replies · 2 participants
  • a

    adams2

    02/08/2018, 12:44 AM
    why does foo not compile?
    i
    1 reply · 2 participants
  • n

    noncom

    02/08/2018, 9:17 AM
    @karelpeeters yes, I know about how static denies inheritance in Java and such.. but what about such a situation? https://gist.github.com/noncom/921a4e322e89424c961eae54bcac41e4
    c
    1 reply · 2 participants
  • d

    diesieben07

    02/08/2018, 11:00 AM
    I was trying to come up with a usecase 😒imple_smile: I was thinking you could then get the companion object from the
    KClass
    and you'd know that it implements the factory interface. But yes, all this is very messy and contrived, you'd be better off just passing around a lambda instead of the
    KClass
    .
    d
    1 reply · 2 participants
  • t

    tristanlim

    02/08/2018, 11:18 AM
    Hey everyone! Is anyone interested in a remote Kotlin gig? The client is a Fintech startup providing a payment solution for merchants, quick to integrate and easy to use. They are looking for Android/Kotlin developers: Start: February Duration: 6 months Location: Remote Requirements: strong knowledge of Android and good knowledge of Kotlin, strong knowledge of Gradle Nice-to-haves: experience with iOS development and tools (should not be afraid to write some iOS code), with CMake and CLion Team: 1 team lead PLEASE MESSAGE ME DIRECTLY 👍
    🚓 1
    k
    1 reply · 2 participants
  • a

    alllex

    02/08/2018, 6:25 PM
    While this works perfectly fine:
    fun bar(x: Int): Int = when (x) {
        0 -> {
            listOf(1).forEach { return 0 }
            error("never")
        }
        else -> 10
    }
    a
    3 replies · 2 participants
  • s

    Shawn

    02/08/2018, 6:32 PM
    from inside a foreach? isn’t that returning from the lambda you’re passing to foreach
    k
    k
    +1
    8 replies · 4 participants
  • k

    Kaj

    02/08/2018, 7:37 PM
    Does anyone know how I can let my Spring controller return a 404? I thought I could just return a nullable variable and if it is null Spring would translate it to a 404. Do I really need to use
    ResponseEntity
    specifically?
    k
    2 replies · 2 participants
  • a

    aphex

    02/08/2018, 10:45 PM
    Is there a way to generate Kotlin from protobufs?
    s
    1 reply · 2 participants
  • c

    cedric

    02/08/2018, 11:30 PM
    I’m not sure it’s that much better than
    if
    but it definitely beats Smalltalk’s
    ifTrue
    and
    ifFalse
    c
    1 reply · 2 participants
  • e

    edwardwongtl

    02/09/2018, 4:43 AM
    Looking at the bytecode, using
    _
    inside a lambda does not change the fact that the compiler will automatically assign a value to
    it
    c
    2 replies · 2 participants
  • y

    YMobile

    02/09/2018, 8:53 AM
    <application android:name = "com.example.DemoApp" ... (edited) And I have created DemoApp in kotlin like this class DemoApp:MultiDexApplication() { ... }
    c
    1 reply · 2 participants
  • k

    koufa

    02/09/2018, 1:22 PM
    Hey. I have an question. (Simplified problem -->)
    class A(val name: String, val country: String)
    class B(val name: String, val age: Int)
    class C(val name: String, val age: Int, val country: String)
    What is the idiomatic way in Kotlin to combine two lists say
    List<A>
    and
    List<B>
    to a new
    List<C>
    if
    C
    is produced from
    A and B
    if
    a.name == b.name
    ?
    k
    d
    +3
    18 replies · 6 participants
  • d

    Dominik.sittel

    02/09/2018, 2:26 PM
    How to use a generic with a constructor inside a class ?
    d
    1 reply · 2 participants
  • d

    Dominik.sittel

    02/09/2018, 2:41 PM
    I don’t get this factory method stuff :(
    d
    c
    10 replies · 3 participants
  • k

    karelpeeters

    02/09/2018, 2:57 PM
    Put everything in a single
    apply
    ?
    👍 2
    p
    7 replies · 2 participants
  • g

    Gerard de Leeuw

    02/09/2018, 3:09 PM
    Does anyone know where to find documentation on how to write a Kotlin compiler plugin? Or at least some general information about the architecture of those plugins. I am currently using JSON-B (Yasson impl) in my project but it can only instantiate a data class when I annotate the constructor and all parameters (providing the parameter name). As a fallback I could of course use the noarg compiler plugin but I was wondering if annotating constructor parameters using a compiler plugin is possible.
    y
    c
    +1
    6 replies · 4 participants
  • s

    Shawn

    02/09/2018, 4:15 PM
    #general is not for self-promotion
    h
    a
    5 replies · 3 participants
  • b

    bj0

    02/09/2018, 6:06 PM
    map {}
    can't be short-circuited like a forloop can right?
    s
    6 replies · 2 participants
  • j

    jimn

    02/09/2018, 9:57 PM
    it all looks the same in the end
    r
    2 replies · 2 participants
  • b

    bhupenk

    02/10/2018, 4:27 PM
    Is there any word on getting SonarQube working with Kotlin code? An announcement of a plugin was expected later last year. Has anyone heard anything? Appreciate.
    c
    1 reply · 2 participants
Powered by Linen
Title
b

bhupenk

02/10/2018, 4:27 PM
Is there any word on getting SonarQube working with Kotlin code? An announcement of a plugin was expected later last year. Has anyone heard anything? Appreciate.
c

Czar

02/10/2018, 5:27 PM
It's in the works, I seem to remember that a couple of weeks back @yole said they will announce it on kotlin blog when it is available.
View count: 12